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 l
Notice that in link_to, you're just providing a string for the route argument. So you can just define a method in a helpers file.
# application_helper.rb
module ApplicationHelper
def signin_path(provider)
"/auth/#{provider.to_s}"
end
end
# view file
<%= link_to 'Sign in with Twitter', signin_path(:twitter) %>
If you want to get all meta
# application_helper.rb
module ApplicationHelper
def method_missing(name, *args, &block)
if /^signin_with_(\S*)$/.match(name.to_s)
"/auth/#{$1}"
else
super
end
end
end
#view file
<%= link_to 'Sign in with Twitter', signin_with_twitter %>