Sunday, December 16, 2012

Re: [Rails] Re: Question: image_tag(source, options = {})

On Mon, Dec 17, 2012 at 12:55 AM, karthikeyan manivasagam
<lists@ruby-forum.com> wrote:
> Use the options directly in image tag as how you use in html tag,but
> little convertion has to be done for Rails code, it will work
>
> HTML : <img alt="logo" src="logo.png" align="right"
> style="background-color:#288AC6; padding:10px;" class="classname"
> id="idname" />
>
> RAILS : <%= image_tag('logo.png', :alt=>'logo',:align=>'right'
> ,:style=>'background-color:##288AC6; padding:10px;' ,:class=>"classname"
> , :id=>"idname") %>
>
> Just make the attribute name in HTML as symbols followed by a value
> as a key value pair
>
> align = "left" HTML
> :align => "left" RAILS

I just want to point out that you should not be using align, it's not
supported in HTML5 because you can use css (read: float) and I also
want to point out that if you are just going to make your ALT the same
as your src minus extension you might as well not bother and let the
spec fail, I wish the engine were smart enough to detect people gaming
the system like that. Your desc should actually be a description or
don't bother, you just take the piss out of the desc attribute and
what it's used for in the current example.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate