Reputation: 634
I have a controller which is placed in /users/account_controller.rb
The route for that is: resources :account controller: 'users/account'
And in the view I have the account
folder under view
not under users
Now when I try to access new on account
is looking for the template users/account/new
how can I point that to account/new
?
Upvotes: 0
Views: 111
Reputation: 33542
You probably may have two options(could be more)
1.Move the account_controller.rb
from the users
and put it under app/controllers
directory. And change your route to resources :account
.
OR
2.Just Place your account
folder in views
under users
.
Upvotes: 1
Reputation: 7950
If you just want to render a specific view in a non-RESTFUL manner, you can just tell rails what to render at the end of your method:
#account_controller.rb
def new
.
.
render 'account/new'
end
Upvotes: 1