Hi !
I’ve pasted Rails Recipe #31: Authentication code, but I wish to use
these methods in several controllers. Then I pasted them in
ApplicationController, using before_filter method in all the other
needed controllers. The problem is that Rails always tries to render a
missing template inside the current controller (
app/views/controllers/admin/article/signin_form.rhtml ) while I’ve
uploaded it in app/views/application/siginin_form.rhtml ).
Is there an issue ?
Thanks for your help.
Eugenol wrote:
I’ve pasted Rails Recipe #31: Authentication code, but I wish to use
these methods in several controllers. Then I pasted them in
ApplicationController, using before_filter method in all the other
needed controllers. The problem is that Rails always tries to render a
missing template inside the current controller (
app/views/controllers/admin/article/signin_form.rhtml ) while I’ve
uploaded it in app/views/application/siginin_form.rhtml ).
You have to put the view in the shared folder and explictly call
render 'shared/siginin_form'
Should rails be changed to automatically render views of shared
actions from the shared folder, so that an explict render of
render "#{controller_name}/view"
is needed only if the view is controller-dependent? Which
is the more common situation. For me, it’s mostly been
a common view, but what option follows the principle of
least surprise?
–
We develop, watch us RoR, in numbers too big to ignore.