How to generate new display of a table

2 views
Skip to first unread message

allis...@gmail.com

unread,
Apr 1, 2008, 2:19:14 PM4/1/08
to ActiveScaffold : Ruby on Rails plugin
Im trying to create a custom action link that when clicked will not
render a nested scaffold. It is much like hitting a refresh button.
When Clicking on the action link the table will be refreshed with a
different set of criteria for what to show.

What Im trying to achieve is showing only records in my table that are
not resolved( a table column) and then when clicking the action link
it will redisplay my same table but with the criteria of only showing
the resolved records.

IS this doable? I sure hope so. It seems so easy yet so hard to get
working.

I have tried many things and have yet to get this to work any and all
help is much appreciated!

mdf

unread,
Apr 2, 2008, 4:51:23 PM4/2/08
to ActiveScaffold : Ruby on Rails plugin
easy way to get a constrained view:

1) create a new controller which inherits from your existing
controller
2) add to new controller conditions_for_collection()
3) when this route works, add a link to your layout (not controller)
<a href="/unresolved_my_models">Unresolved</a>

class UnresolvedMyModelsController < MyModelsController
def conditions_for_collection
"`resolved` = 0"
end
end

If you really need a link *within* your active_scaffold see:
http://www.activescaffold.com/docs/api-action-link, and
look at AS "search" do_search and friends
Reply all
Reply to author
Forward
0 new messages