Good notes posted by concept47
RSS feed
concept47 -
April 27, 2013 - (v3.1.0 - v3.2.13)
4 thanks
use validates :name, :presence => true instead
validates_presence_of is a holdover from the Rails 2 days.
This is the way it is done now http://guides.rubyonrails.org/active_record_validations_callbacks.html#presence
concept47 -
December 1, 2010
4 thanks
link to nothing if link_to_if condition is false
When the link_to_if condition is false you can get this helper to display nothing by doing something like this
<%= link_to_if(message.user, 'Poster', message.user){} %>
^ That will display nothing if message.user does not exist.