The solution that is good for me:

        <% if controller.action_name == 'new' %>
        <%= f.text_field :image_url, :value => 'no image' %>
        <% else %>
        <%= f.text_field :image_url %>
        <% end %>

and then in index.erb set smth like that
<%= product.image_url == 'no image' ? image_tag("/images/
empty.png", :alt => 'Book cover', :class => 'list_image') :
image_tag("/images/#{product.image_url}", :alt => 'Book cover', :class
=> 'list_image') %>
to set work on the default value for this.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to