Reputation: 2339
I'm trying to basically have a toggle switch for a resource.... However when i pass the block as the second option, i can no longer sort by that column.
column :Playable do |level|
link_to level.playable || 'false', "levels/#{level.id}/toggle"
end
# ... later
member_action :toggle do
level = Level.find(params[:id]);
level.update_attribute("playable", !level.playable)
redirect_to(:back)
end
Upvotes: 0
Views: 326
Reputation: 16011
Please try:
column :Playable, :sortable => :playable do |level|
...
end
Upvotes: 3