Nicky,
On 10.4.2005, at 22:11, Nickolay Kolev wrote:
> Hi all,
>
> is there a way to get the name of the action that called for rendering
> of a component?
>
> When used in a component controller.action_name gets the name of the
> component itself and I need the name of the action that called for it.
>
> Any ideas?
I''m not sure about that, but one way that might solve your problem is
to use a specific target instance variable and take action upon that in
the view.
E.g. if you''re using the same view for both create and update actions:
def create
@target = "create"
...
render_action "edit"
end
def update
@target = "update"
...
render_action "edit"
end
In the view:
<%= @target == "create" ? "Create new widget" :
"Edit widget" %>
//jarkko
>
> Many thanks in advance!
>
> Nicky
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Jarkko Laine
http://jlaine.net
http://odesign.fi
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails