Hello all, Sorry for flooding the list with silly questions lately, but I''m having some difficulty with some basic concepts in Rails. 1) What is the difference between an item prefixed with a colon and one without (as in :class => "test" vs class => test). I think there''s a major concept I''m missing out on here, as this problem nails me frequently. 2) How in the world do I make an image link? I know how to do it in HTML, but how the heck do I nest calls to helpers? In this case I''d be using the <%= image_tag ... %> inside of a <%link_to...%>. How do I do this? Thanks, Will --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
An item prefixed with a colon is a symbol. It''s sort of like a string.
"class" => "test", :class => "test", etc.
Without a colon prefixed, it would
be a variable.
<%= link_to image_tag("image.jpg"), :controller =>
''main'', :action =>
''index'' %>
just like,
<%= link_to "Text", :controller => ''main'',
:action => ''index'' %>
Just replace the text that you want to link to with your image_tag.
You might want to read a few basic texts on Ruby before starting out.
Why''s
guide is a good intro (and fun), or the first edition of the Pickaxe is also
available online, and it provides a good enough "textbookish"
coverage.
Vish
On 9/25/06, Will Gant
<williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:>
> Hello all,
> Sorry for flooding the list with silly questions lately, but I''m
having
> some difficulty with some basic concepts in Rails.
>
> 1) What is the difference between an item prefixed with a colon and one
> without (as in :class => "test" vs class => test). I think
there''s a major
> concept I''m missing out on here, as this problem nails me
frequently.
> 2) How in the world do I make an image link? I know how to do it in HTML,
> but how the heck do I nest calls to helpers? In this case I''d be
using the
> <%= image_tag ... %> inside of a <%link_to...%>. How do I do
this?
>
> Thanks,
> Will
>
> ------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone
Calls<http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com>to
the US (and 30+ countries) for 2¢/min or less.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
Cool. Thanks man. Do you have a link for the pickaxe book?
Vishnu Gopal <g.vishnu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: An
item prefixed with a colon is a symbol. It''s sort of like a string.
"class" => "test", :class => "test", etc.
Without a colon prefixed, it would be a variable.
<%= link_to image_tag(" image.jpg"), :controller =>
''main'', :action => ''index'' %>
just like,
<%= link_to "Text", :controller => ''main'',
:action => ''index'' %>
Just replace the text that you want to link to with your image_tag.
You might want to read a few basic texts on Ruby before starting out.
Why''s guide is a good intro (and fun), or the first edition of the
Pickaxe is also available online, and it provides a good enough
"textbookish" coverage.
Vish
On 9/25/06, Will Gant
<williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: Hello all,
Sorry for flooding the list with silly questions lately, but I''m having
some difficulty with some basic concepts in Rails.
1) What is the difference between an item prefixed with a colon and one without
(as in :class => "test" vs class => test). I think
there''s a major concept I''m missing out on here, as this
problem nails me frequently.
2) How in the world do I make an image link? I know how to do it in HTML, but
how the heck do I nest calls to helpers? In this case I''d be using the
<%= image_tag ... %> inside of a <%link_to...%>. How do I do this?
Thanks,
Will
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
countries) for 2¢/min or less.
(What is best in life?) To crush your enemies, see them driven before you, and
to hear the lamentations of the women. - Conan the Barbarian
---------------------------------
All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
On 9/24/06, Will Gant <williamwgant-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> Cool. Thanks man. Do you have a link for the pickaxe book?http://www.rubycentral.com/book/ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---