views:

10

answers:

0

I have a view of a Model, and there is an attribute 'direct' which can either be 'true' or 'false'.

Am wondering if there's a standard way or even a plugin/gem or just good suggestions on how that can be toggled on or off in the view.

I found myself writing alot of logic in the view so stopped and sought some guidance.

A simple version.

If contact.direct == true toggle button text = "Make Indirect"

else if contact.direct == false # false is the default toggle button text = "Make Direct"

Or something to that....

Wondering whether I should use link_to_remote as the mechanism for the ajax and then how to do the controller.