I am trying to figure how to break up a Get into 2 seperate views. Scenario, user goes to index page and sees list of their posts with links to show, edit, destroy. Cool and working well. However in the show portion there is not enough room to display all the information. So in the show.rhtml page I have 90% of the information, then I want to put a link at the bottom to take them to the rest of the post information. Not sure how to do this restful proper. TIA Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am trying to figure how to break up a Get into 2 seperate views. > Scenario, user goes to index page and sees list of their posts with > links to show, edit, destroy. > Cool and working well. > However in the show portion there is not enough room to display all > the information. So in the show.rhtml page I have 90% of the > information, then I want to put a link at the bottom to take them to > the rest of the post information. Not sure how to do this restful > proper. > TIA > Stuart >I''m trying to creating a route for this option. I have map.resources :positions, :collection => {:description => :show} I believe that I need to create an action in the positions controller called description and then the helper url , should be description_position_path. However I''m getting an exception: NoMethodError in Positions#show Showing app/views/positions/show.rhtml where line #73 raised: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.to_sym Not sure if this is the right approach and i''m doing something wrong or this is the wrong approach completely. Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: I guess it''s getting closer to figuring this out but I can still use some help. Trying to create an action in my restful controller so I can display more "show" information. In my routes.rb - map.resources :positions, :collection => {:description => :get} In the "show.rhtml" , I''ve added a link to see the additonal information - <%= link_to ''Show'', description_positions_path %> In the action Description - def description @position = Position.find(params[:id]) respond_to do |format| format.html format.xml {render :xml => @position.to_xml } end end Leaving it like this allow me to load the first show page but when I hit the description link - I get Couldn''t find Position without an ID yet if I go back to my link and do <%= link_to ''Show'', description_positions_path(position) %> Then it won''t load the show.rhtml and gives me the error of undefined variable or method. Anyone help ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bump ...:) Don''t be mad. On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I guess it''s getting closer to figuring this out but I can still use > some help. Trying to create an action in my restful controller so I > can display more "show" information. > > In my routes.rb - > map.resources :positions, :collection => {:description => :get} > > In the "show.rhtml" , I''ve added a link to see the additonal information - > <%= link_to ''Show'', description_positions_path %> > > In the action Description - > def description > @position = Position.find(params[:id]) > respond_to do |format| > format.html > format.xml {render :xml => @position.to_xml } > end > end > > Leaving it like this allow me to load the first show page but when I > hit the description link - I get > Couldn''t find Position without an ID > > yet if I go back to my link and do <%= link_to ''Show'', > description_positions_path(position) %> > Then it won''t load the show.rhtml and gives me the error of undefined > variable or method. > > Anyone help ? > Stuart > -- > http://en.wikipedia.org/wiki/Dark_ambient >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
use :member map.resources :positions, :member => {:description => :get} and: <%= link_to ''Show'', description_positions_path(position) %> On Oct 2, 2006, at 11:54 AM, Dark Ambient wrote:> > On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I guess it''s getting closer to figuring this out but I can still use > some help. Trying to create an action in my restful controller so I > can display more "show" information. > > In my routes.rb - > map.resources :positions, :collection => {:description => :get} > > In the "show.rhtml" , I''ve added a link to see the additonal > information - > <%= link_to ''Show'', description_positions_path %> > > In the action Description - > def description > @position = Position.find(params[:id]) > respond_to do |format| > format.html > format.xml {render :xml => @position.to_xml } > end > end > > Leaving it like this allow me to load the first show page but when I > hit the description link - I get > Couldn''t find Position without an ID > > yet if I go back to my link and do <%= link_to ''Show'', > description_positions_path(position) %> > Then it won''t load the show.rhtml and gives me the error of undefined > variable or method. > > Anyone help ? > Stuart > -- > http://en.wikipedia.org/wiki/Dark_ambient > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
use :member map.resources :positions, :member => {:description => :get} and: <%= link_to ''Show'', description_positions_path(position) %> On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I guess it''s getting closer to figuring this out but I can still use > some help. Trying to create an action in my restful controller so I > can display more "show" information. > > In my routes.rb - > map.resources :positions, :collection => {:description => :get} > > In the "show.rhtml" , I''ve added a link to see the additonal information - > <%= link_to ''Show'', description_positions_path %> > > In the action Description - > def description > @position = Position.find(params[:id]) > respond_to do |format| > format.html > format.xml {render :xml => @position.to_xml } > end > end > > Leaving it like this allow me to load the first show page but when I > hit the description link - I get > Couldn''t find Position without an ID > > yet if I go back to my link and do <%= link_to ''Show'', > description_positions_path(position) %> > Then it won''t load the show.rhtml and gives me the error of undefined > variable or method. > > Anyone help ? > Stuart > -- > http://en.wikipedia.org/wiki/Dark_ambient > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > use :member > > map.resources :positions, :member => {:description => :get} > > and: > > <%= link_to ''Show'', description_positions_path(position) %> >Nope, when I try to do this I get NameError in Positions#show Showing app/views/positions/show.rhtml where line #73 raised: undefined local variable or method `position'' for #<#<Class:0x6483738>:0x6482c40> I don''t get it , I''ve read the documentation 12x now so it looks like this would work. Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/2/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > use :member > > > > map.resources :positions, :member => {:description => :get} > > > > and: > > > > <%= link_to ''Show'', description_positions_path(position) %> > > > Nope, when I try to do this I get > NameError in Positions#show > Showing app/views/positions/show.rhtml where line #73 raised: > undefined local variable or method `position'' for > #<#<Class:0x6483738>:0x6482c40> > > I don''t get it , I''ve read the documentation 12x now so it looks like > this would work. > > Stuart >But this link does work: <%= link_to "Preview Description", :controller => ''positions'', :action => ''description'', :id => @position.id %> And gives me a url of /positions/22;description , which I think looks right ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sorry, I believe it is singular: <%= link_to ''Show'', description_position_path(position) %> On Oct 2, 2006, at 3:33 PM, Dark Ambient wrote:> > On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> use :member >> >> map.resources :positions, :member => {:description => :get} >> >> and: >> >> <%= link_to ''Show'', description_positions_path(position) %> >> > Nope, when I try to do this I get > NameError in Positions#show > Showing app/views/positions/show.rhtml where line #73 raised: > undefined local variable or method `position'' for > #<#<Class:0x6483738>:0x6482c40> > > I don''t get it , I''ve read the documentation 12x now so it looks like > this would work. > > Stuart > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nope, dont be sorry. Actually the plural version renders a path but without an id produce a "stack too deep" error, with (position) it returns the same no method error. Stuart On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > sorry, I believe it is singular: > > <%= link_to ''Show'', description_position_path(position) %> > > > On Oct 2, 2006, at 3:33 PM, Dark Ambient wrote: > > > > > On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > >> use :member > >> > >> map.resources :positions, :member => {:description => :get} > >> > >> and: > >> > >> <%= link_to ''Show'', description_positions_path(position) %> > >> > > Nope, when I try to do this I get > > NameError in Positions#show > > Showing app/views/positions/show.rhtml where line #73 raised: > > undefined local variable or method `position'' for > > #<#<Class:0x6483738>:0x6482c40> > > > > I don''t get it , I''ve read the documentation 12x now so it looks like > > this would work. > > > > Stuart > > > > > > > > > >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Clearly, I''m still learning how this stuff works, too. I just looked at my links and I actually don''t use the named routes for this sort of example. On 10/3/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Nope, dont be sorry. Actually the plural version renders a path but > without an id produce a "stack too deep" error, with (position) it > returns the same no method error. > > Stuart > > On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > sorry, I believe it is singular: > > > > <%= link_to ''Show'', description_position_path(position) %> > > > > > > On Oct 2, 2006, at 3:33 PM, Dark Ambient wrote: > > > > > > > > On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > > >> use :member > > >> > > >> map.resources :positions, :member => {:description => :get} > > >> > > >> and: > > >> > > >> <%= link_to ''Show'', description_positions_path(position) %> > > >> > > > Nope, when I try to do this I get > > > NameError in Positions#show > > > Showing app/views/positions/show.rhtml where line #73 raised: > > > undefined local variable or method `position'' for > > > #<#<Class:0x6483738>:0x6482c40> > > > > > > I don''t get it , I''ve read the documentation 12x now so it looks like > > > this would work. > > > > > > Stuart > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
We''re all still learning this stuff :). However I think that the way I crafted the link is acceptable. I did find it on one of the restful pages. Stuart On 10/3/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Clearly, I''m still learning how this stuff works, too. I just looked at my > links and I actually don''t use the named routes for this sort of example. > > > On 10/3/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Nope, dont be sorry. Actually the plural version renders a path but > > without an id produce a "stack too deep" error, with (position) it > > returns the same no method error. > > > > Stuart > > > > On 10/2/06, Jamie Orchard-Hays < jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > sorry, I believe it is singular: > > > > > > <%= link_to ''Show'', description_position_path(position) %> > > > > > > > > > On Oct 2, 2006, at 3:33 PM, Dark Ambient wrote: > > > > > > > > > > > On 10/2/06, Jamie Orchard-Hays <jamieorc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> > > > >> use :member > > > >> > > > >> map.resources :positions, :member => {:description => :get} > > > >> > > > >> and: > > > >> > > > >> <%= link_to ''Show'', description_positions_path(position) %> > > > >> > > > > Nope, when I try to do this I get > > > > NameError in Positions#show > > > > Showing app/views/positions/show.rhtml where line #73 raised: > > > > undefined local variable or method `position'' for > > > > #<#<Class:0x6483738>:0x6482c40> > > > > > > > > I don''t get it , I''ve read the documentation 12x now so it looks > > like > > > > this would work. > > > > > > > > Stuart > > > > > > > >-- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---