Notes posted by Graffzon

RSS feed
March 5, 2012
0 thanks

Example of conditions using

f.e.

validates :number, :presence => { :if => :quota_file? }

def self.quota_file?
  quota_file?
end
November 10, 2011
0 thanks

logic in class/id

If you need to place some simple logic in class or like that, I think that best to make it with simple brackets:

Code example

<%= link_to ‘All actions’, switch_action_tab_path, :remote => true, :class => (‘selected’ if @tab == ‘all’) %>