Flowdock

Notes posted by bansalakhil

RSS feed
April 16, 2009
2 thanks

Various use cases

Example

user = User.new
user.name = 'Akhil Bansal'
user.save

user =  User.new(:name => 'Akhil')
user.save

User.new do |u|
  u.name = 'Akhil'
  u.save
end
March 10, 2009
1 thank

Image as a submit button

use image_sugmit_tag to use an image as a submit button

February 13, 2009
1 thank

throws exception

when use use Model.find([1,2,3,4])

throws exception if no record exists with any of this ID

February 12, 2009
0 thanks

using collection=objects

It will fire one insert query per new record

January 16, 2009
7 thanks

/products/1

Code example

current_page?(product_path(@product))
# => true
January 9, 2009 - (v2.2.1)
0 thanks

Dynamic labels

Code example

<%=label_tag 'category_'+cat.title, cat.title%>