On Jueves, 9 de Septiembre de 2010 08:17:25 mikelb escribió:
> Where can I find some documentation on how to create a custom action?
>
> What I have is this:
>
> Store
> Id
> Schedule
> StoreId
> ... (etc)
>
> On the Store page, I can create new schedules. What I would also like
> to be able to do is to search for another schedule and "clone" it,
> filling it with the store_id of the store i want to associate with
> it....
>
> Where would I go about starting something like that?
Do you need help adding a link for custom action or to code that custom
action?
For the link, look at options in API: action link. You will add a new link
with config.action_links.add
For coding your action, the only special is the response with JS or HTML. Do
it as a non AS action, and add a respond_to block:
respond_to do |format|
format.html { return_to_main }
format.js
end
For JS action, use frontends/default/views/on_create.js.rjs as a template for
your clone.js.rjs view file. Your view should be simpler than on_create.js.rjs
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [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.