After I looked at Ryan, the excellent Railcast Simple OmniAuth , I was able to implement authentication in my application.
Everything works fine, but in my opinion, I have links that look like this:
<%= link_to 'Sign in with Twitter', '/signin/twitter' %> <%= link_to 'Sign in with Facebook', '/signin/facebook' %>
I was wondering if there is an elegant way to create a named route to replace it:
<%= link_to 'Sign in with Twitter', signin_twitter_path %> <%= link_to 'Sign in with Facebook', signin_facebook_path %>
or
<%= link_to 'Sign in with Twitter', signin_path(:twitter) %> <%= link_to 'Sign in with Facebook', signin_path(:facebook) %>
OmniAuth already processes these routes ... In my routes.rb
, I have stuff for callbacks and checkout:
match '/signin/:provider/callback' => 'sessions#create' match '/signout' => 'sessions#destroy', :as => :signout
Therefore, I do not know where I could create these named routes.
Any help would be appreciated. Thanks.
ruby-on-rails routes omniauth
Daniel Perez Alvarez
source share