$("#enable_<%= @attribute.id %>").toggle(); $("#disable_<%= @attribute.id %>").toggle(); $("#attribute_<%= @attribute.id %>").toggleClass('disable');