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
Please try: