socialcast / devise_oauth2_providable

Rails3 engine integrating OAuth2 authentication with Devise
MIT License
219 stars 102 forks source link

NameError Devise/oauth2_providable/authorizations#new #27

Closed gregwinn closed 12 years ago

gregwinn commented 12 years ago

Hey, I am having a small issue with my layout and using Devise/oauth2_providable. I have Devise 100% up and working, the oauth2 has been tested from a client and is working to a point.

This issue i am getting is:

NameError in Devise/oauth2_providable/authorizations#new

undefined local variable or method `settings_path' for #<#Class:0x007fd465b29378:0x007fd465aca328>

This issue shows it self when the user try's to login (oauth2/authorize) from oauth2. So the user is coming from the client to the provider to approve the client.


Here is whats in the view:

<%=link_to "Settings", settings_path%>

Here is the route to back it up:

match 'settings' => 'dashboard#settings', :as => :settings


What am i doing wrong here? I can remove the link from the view and it works just fine. Any help would be great, thanks!!


Rails 3.1.1 Ruby 1.9.2-p290

wireframe commented 12 years ago

The devise_oauth2_providable routes are a rails3 mountable engine, so you will need to use main_app.settings_path to reference routes within your main application.

railscasts tutorial for mountable engine: http://railscasts.com/episodes/277-mountable-engines

masterkain commented 12 years ago

A mention in the Readme would be nice :)

masterkain commented 12 years ago

By the way, what name should have a layout for this engine in case we want a custom one just for those endpoints?

karlfreeman commented 12 years ago

+1 on the Readme. Thankfully a quick google leads straight here.

jure commented 12 years ago

I can change all my url helpers to be main_app.#{url_helper_name}, but what about url helper methods within gems?

My layout is raising an exception because a gem has a url helper that is not referenced with main_app name-spacing.

In any case, this seems weird to me. Shouldn't the /oauth2/authorize raise an exception if it's missing some crucial data in params, instead of displaying the layout?