Sanjay wrote ...
> Hi Geeks, need your help here
> I have set the controller code as below
>
> active_scaffold :todo do |config|
> config.columns = [ :body, :done,:due]
> columns[:body].label = "Description"
> columns[:due].label ="Due on"
> columns[:done].label = "Done"
> >> config.create.persistent=true
> end
>
> and as the api:create says
> " A flag for whether the create form should be persistent or not. If
> persistent, then after a successful create it will stay open. Default
> is false."
>
> it is persistent after first create, but how do i keep it open the
> first time when the page is visited.
Do you mean, "how can the create form be opened when the page is first
visited?" If so, try something like the following.
In app/views/todos/list.rhtml:
<%= render :super %>
<script type="text/javascript">
<% new_selector = "#{action_link_id(:new, nil)}".to_json %>
<%= "$(#{new_selector}).action_link.open();" %>
</script>
If there's a better way to do that, I'd be interested in knowing what it
is, but that worked for me (in an older project with AS 1.1.1 and Rails
2.0.x but I have not tested it with more recent versions).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---