Walter Davis wrote in post #1183553:
>> an image + title or alt attribute as a string and then nest this model
>> inside another one (e.g. posts or articles etc..). I am still one week
>> into rails, but I believe this is the rails way to do it.
>>
>
> The usual way that you do that is to define columns on the ActiveRecord
> model that has the image attached to it, and then when you use the
> image_tag helper, you can access those and use them.
>
> image_tag @your_object.file.thumb('200x200#').url, alt:
> @your_object.alt, title: @your_object.title
>
> If you haven't done so already, please do yourself a favor and invest a
> few days in working all the way through railstutorial.org. It's free to
> read and use on line, and it is the best way to learn the basics (and
> more importantly, the idioms) of Rails. It is an investment that will
> pay off for years to come.
>
> Walter
Thanks for all the information. Despite that the whole Rails / Ruby
system is very new to me, I sense the great power found in here. Things
can be achieved fast and accurately with far fewer lines of code than
other systems. Moreover, I simply like this framework.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/78eee9b57bec83ca3bd951b4f8cf9b45%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment