Monday, August 30, 2010

select box Send Id, display name..


used this to send the ID in params & display name in the select box.

select_tag "user", options_from_collection_for_select(User.all, :id, :name)

For adding option & showing selected params,

select_tag "user_id", "<option>select one</option>" + options_from_collection_for_select(User.all, :id, :name, params[:user_id].to_i)


Thursday, August 19, 2010

Image submit tag without border

Hi, I used image_submit_tag to submit my form. worked fine.. but the
image is displayed with border.

I used border => 0 but no use.

This is was code.

<%= image_submit_tag "../images/upload.png", :border => 0 %>

& This worked

<%= image_submit_tag "../images/upload.png", :style => "border: none;" %>