Hi all, I''m modifying the HTML design to fit into my Rails app, and have the following problem... In HTML, there''s a code that says: <a class="rightareah3" href="#"><h3> Some text stuff here </h3></a> I''m trying to convert it to Rails code, and have the following: <div id="rightareah3"> <h3> <%= link_to h (item.title), :action => ''show'', :id => item %> </h3> </div> .. and it doesn''t work. If I replace link_to with some plain text, it works, so I know it''s link_to. I''m using Ruby 1.8.2 and Rails 1.1.0 Your help is GREATLY appreciated, thanks!!! -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
Using Rails 1.2 here replacing your local variable as the instance @item the follow code worked: <% @item = ''My Title'' %> <div id="rightareah3"> <h3> <%= link_to h (@item), :action => ''show'', :id => 1 %> </h3> </div> Is your local variable coming from a loop for item? Blaine On Mar 13, 4:37 pm, zavulon <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all, > > I''m modifying the HTML design to fit into my Rails app, and have the > following problem... In HTML, there''s a code that says: > > <a class="rightareah3" href="#"><h3> Some text stuff here </h3></a> > > I''m trying to convert it to Rails code, and have the following: > > <div id="rightareah3"> > <h3> > <%= link_to h (item.title), :action => ''show'', :id => item %> > </h3> > </div> > > .. and it doesn''t work. If I replace link_to with some plain text, it > works, so I know it''s link_to. > > I''m using Ruby 1.8.2 and Rails 1.1.0 > > Your help is GREATLY appreciated, thanks!!! > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
blaine wrote:> Using Rails 1.2 here replacing your local variable as the instance > @item the follow code worked: > > <% @item = ''My Title'' %> > > <div id="rightareah3"> > <h3> > <%= link_to h (@item), :action => ''show'', :id => 1 %> > </h3> > </div> > > Is your local variable coming from a loop for item? > > BlaineThanks Blaine. I upgraded to rails 1.2, tried the above, and it still didn''t work :-( Yes, my local variable does come from a loop for ''item''. -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
> <%= link_to h (item.title), :action => ''show'', :id => item %>How about: <%= link_to h (item.title), :action => ''show'', :id => item.id %> Nelson Basedex - A Collaborative Index to organize and collect everything related to Ruby on Rails http://blazingrails.basedex.com/index/8 -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
I think I didn''t explain my problem correctly. The problem is not that the link doesn''t work, it''s that the formatting is not showing up correctly. I.e. whatever text formatting I put in the "a.rightareah3" area of CSS file, it''s not showing up on resulting HTML. -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
zavulon wrote:> I think I didn''t explain my problem correctly. The problem is not that > the link doesn''t work, it''s that the formatting is not showing up > correctly. I.e. whatever text formatting I put in the "a.rightareah3" > area of CSS file, it''s not showing up on resulting HTML.Ahhh... <%= link_to h (item.title), { :action => ''show'', :id => item}, :id => "rightareah3" %> Nelson -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
Nelson Hsu wrote:> zavulon wrote: >> I think I didn''t explain my problem correctly. The problem is not that >> the link doesn''t work, it''s that the formatting is not showing up >> correctly. I.e. whatever text formatting I put in the "a.rightareah3" >> area of CSS file, it''s not showing up on resulting HTML. > > Ahhh... > > <%= link_to h (item.title), { :action => ''show'', :id => item}, :id => > "rightareah3" %> > > NelsonSorry...that should be <%= link_to h (item.title), { :action => ''show'', :id => item}, :class => "rightareah3" %> Nelson -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
Nelson Hsu wrote:> Nelson Hsu wrote: >> zavulon wrote: >>> I think I didn''t explain my problem correctly. The problem is not that >>> the link doesn''t work, it''s that the formatting is not showing up >>> correctly. I.e. whatever text formatting I put in the "a.rightareah3" >>> area of CSS file, it''s not showing up on resulting HTML. >> >> Ahhh... >> >> <%= link_to h (item.title), { :action => ''show'', :id => item}, :id => >> "rightareah3" %> >> >> Nelson > > Sorry...that should be > > <%= link_to h (item.title), { :action => ''show'', :id => item}, :class => > "rightareah3" %> > > NelsonThat''s exactly what I needed! Thank you!! I''m very sorry that I wasn''t clear the first time around. -- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
how to this with div...I dont have class how to make div propertie apply to the link_to ???? raj.>> Nelson > > That''s exactly what I needed! Thank you!! I''m very sorry that I wasn''t > clear the first time around.-- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---
I got it. \Raj wrote:> how to this with div...I dont have class > > how to make div propertie apply to the link_to > ???? > > raj. > >>> Nelson >> >> That''s exactly what I needed! Thank you!! I''m very sorry that I wasn''t >> clear the first time around.-- 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 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?hl=en -~----------~----~----~----~------~----~------~--~---