Rio wrote ...
> I'd like to be able to configure form_ui differently for create vs.
> update actions. I know the following won't work, but was wondering if
> anyone had any suggestions?
>
> config.create.columns[:column_name].form_ui = :ui
Put it in a before filter. For example,
class XyzController < ApplicationController
before_filter :update_config
...
def update_config
if params[:action] == 'new'
# Settings for new/create
active_scaffold_config.create.columns[:column_name].form_ui =
ui_for_create
else
# Settings for edit/update
active_scaffold_config.create.columns[:column_name].form_ui =
ui_for_update
end
end
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---