Hi, this error is correct because if you wanted to render an action''s
template or any template within a controller''s action, you would do the
following:
# Render a template associated with an action
a) render :action => ''action_name''
# Render a template
b) render :template => ''controller_name/action_name''
In your example, ''../shared/dosomething'' isn''t an
action but a path to a
template file. You should not try to use a relative path or path as the
value for the :action key. This will fail now and it was a bug before if it
worked previous to 2.1. If you don''t truly know how to use a
particular
method in Rails, then I would highly recommend consulting the API:
http://api.rubyonrails.org/
Good luck,
-Conrad
On Sun, Jun 1, 2008 at 8:57 PM, rubynuby
<dearluu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> I just updated to rails 2.1 and it seems render :action with a
> relative path no longer works. I.e.,
>
> render :action => ''dosomething''
>
> is okay, but
>
> render :action => ''../shared/dosomething''
>
> throws a template not found exception.
>
> render :template => ''/shared/dosomething''
>
> works for html.erb but for .rjs.js file I get javascript exceptions
> which I don''t get with render :action.
>
> Any suggestion appreciated.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---