After having watched Ryan's excellent Railcast Simple OmniAuth, I've managed to implement authentication in my app.
Everything is working fine, but in my view 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 that with:
<%= 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 handles those routes... In my routes.rb
file I only have stuff for callbacks and signing out:
match '/signin/:provider/callback' => 'sessions#create'
match '/signout' => 'sessions#destroy', :as => :signout
So I don't know where I could create those named routes.
Any help will be appreciated. Thanks.