So this is another obvious question, but if you''re referring to something using Erb, such as <%=@page.title%>, and you need to put that into a link_to tag, how would you do it? I have: <%= link_to(post.title, :action=>''show'', :id=>post%> But that doesn''t seem to work. Thoughts? Thanks, Ron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This should work: <%= link_to(@page.title, :action=>''show'', :id=>post%> On Thu, Mar 6, 2008 at 2:31 PM, Ron <stecklyenator-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > So this is another obvious question, but if you''re referring to > something using Erb, such as <%=@page.title%>, and you need to put > that into a link_to tag, how would you do it? > > I have: > <%= link_to(post.title, :action=>''show'', :id=>post%> > > But that doesn''t seem to work. Thoughts? > > Thanks, > > Ron > > >-- Henry http://www.henrywagner.org/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That did wind up working. Thanks, Henry! Ron On Mar 6, 2:42 pm, "Henry Wagner" <hjw3...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This should work: > > <%= link_to(@page.title, :action=>''show'', :id=>post%> > > > > On Thu, Mar 6, 2008 at 2:31 PM, Ron <stecklyena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > So this is another obvious question, but if you''re referring to > > something using Erb, such as <%...@page.title%>, and you need to put > > that into a link_to tag, how would you do it? > > > I have: > > <%= link_to(post.title, :action=>''show'', :id=>post%> > > > But that doesn''t seem to work. Thoughts? > > > Thanks, > > > Ron > > -- > Henryhttp://www.henrywagner.org/--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 6, 2008, at 2:31 PM, Ron wrote:> I have: > <%= link_to(post.title, :action=>''show'', :id=>post%> > > But that doesn''t seem to work. Thoughts?Ron, I know you have your question answered, but in the future if you provide more specifics than "doesn''t seem to work," you can get better help. If it''s breaking, a stack trace might be in order. Also, a little more context is useful. For example, telling us you set @page in your controller or something like that. I think that will make your feedback from the community quicker and more accurate. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi s.ross,
That''s a very good point. I should have been more clear. My
controller has for this action the following:
def list
@post_pages, @posts = paginate :posts, :per_page => 10
@pages=Page.find(:all)
@events=Event.find(:all)
end
I wound up modifying Henry''s suggestion to:
<%= link_to post.title, :action=>''show'',
:id=>post%>
There was just a problem with the parenthesis.
Ron
On Mar 6, 3:15 pm, "s.ross"
<cwdi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On Mar 6, 2008, at 2:31 PM, Ron wrote:
>
> > I have:
> > <%= link_to(post.title, :action=>''show'',
:id=>post%>
>
> > But that doesn''t seem to work. Thoughts?
>
> Ron, I know you have your question answered, but in the future if you
> provide more specifics than "doesn''t seem to work," you
can get better
> help. If it''s breaking, a stack trace might be in order.
>
> Also, a little more context is useful. For example, telling us you set
> @page in your controller or something like that.
>
> I think that will make your feedback from the community quicker and
> more accurate.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Great, glad to help. Henry On Thu, Mar 6, 2008 at 3:12 PM, Ron <stecklyenator-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > That did wind up working. Thanks, Henry! > > Ron > > On Mar 6, 2:42 pm, "Henry Wagner" <hjw3...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > This should work: > > > > <%= link_to(@page.title, :action=>''show'', :id=>post%> > > > > > > > > On Thu, Mar 6, 2008 at 2:31 PM, Ron <stecklyena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > So this is another obvious question, but if you''re referring to > > > something using Erb, such as <%...@page.title%>, and you need to put > > > that into a link_to tag, how would you do it? > > > > > I have: > > > <%= link_to(post.title, :action=>''show'', :id=>post%> > > > > > But that doesn''t seem to work. Thoughts? > > > > > Thanks, > > > > > Ron > > > > -- > > Henryhttp://www.henrywagner.org/ > > >-- Henry http://www.henrywagner.org/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---