I'm trying to add a simple custom action_link that modifies another
table/model and then displays a message to the user in
active_scaffolds flash[:notice].

Here is my action_link

    config.action_links.add 'flush_all',
      :action => 'flush_all', :page => :true,
      :type => :collection, :label => 'Flush All', :crud_type
=> :destroy,
      :security_method => :delete_authorized?,
      :inline => false, :position => :false,
      :confirm => 'Click OK to continue.'

Here is the method in the active_scaffold controller

  def flush_all
    # bogus code that does stuff
    HappyPeople.find_or_initialize_by_name('happy_person').save!
    flash[:info] = 'happy person updated'
    return_to_main
  end

When I click on the link from the scaffold and click OK in the
javascript popup, the action is run as a JS request and I never see
the flash message. If I hit the URL of the action link directly
(e.g., /happy_peoples/flush_all/) the action is run and I see the
flash message. How can I make the action_link open with HTML behavior
and not JS. I thought this is what :page => :true was supposed to do?

Thanks.

-Nick

-- 
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.

Reply via email to