Hi, I'm sure that this is very easy but I don't get it. I have an
action_link type :member, called "Empty". It must reset some fields of
the member.
So:
config.action_links.add :empty,
:label => "Vaciar", :type => :member,
:inline => true, :position => false,
:crud_type => :update
def empty
... do something with @record ...
flash[:info] = "Vaciado"
render :update do |page|
page.replace_html active_scaffold_messages_id, :partial => "messages"
end
end
However trying to use @record is incorrect as it's nil. I think I must
take the :id parameter sent in the GET request and use it to find the
corresponding entry using MyModel.find(:id).
But I don't know how to get such :id, perhaps something as @params[;id] ?
Thanks a lot.
--
Iñaki Baz Castillo
<[email protected]>
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.