I have a :user has_many :events has_many :signups map.resources :users do |user| user.resources :events do |event| event.resources :signups end end But in the 3rd nested resource im having trouble with the form_for( ) function. The link to the page where the form lies works and i linked to it with: new_user_event_signup_path(@user, @event) but the page doesnt render with anything i have tried, and i have tried....! so far ive tried: form_for([@user, @signup]) form_for([@user, @event]) form_for([@event, @signup]) and everything in between... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
oh, and i have tried all variations of 3 instances aswell... such as form_for([@user, @event, @signup]) On Mar 5, 4:04 pm, betaband <nospacesallonew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a > > :user has_many :events has_many :signups > > map.resources :users do |user| > user.resources :events do |event| > event.resources :signups > end > end > > But in the 3rd nested resource im having trouble with the form_for( ) > function. > The link to the page where the form lies works and i linked to it > with: new_user_event_signup_path(@user, @event) but the page > doesnt render with anything i have tried, and i have tried....! > > so far ive tried: > > form_for([@user, @signup]) > form_for([@user, @event]) > form_for([@event, @signup]) > > and everything in between...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
3 levels deep nesting is not nessessary, as the event as parent to the signup is enough to keep a unique scope on the signup object. 1) use these routes: map.resources :users do |user| user.resources :events end map.resources :events do |event| event.resources :signups end 2) and this form defintion: form_for([@event, @signup]) and everything is fine. On 5 Mrz., 16:04, betaband <nospacesallonew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a > > :user has_many :events has_many :signups > > map.resources :users do |user| > user.resources :events do |event| > event.resources :signups > end > end > > But in the 3rd nested resource im having trouble with the form_for( ) > function. > The link to the page where the form lies works and i linked to it > with: new_user_event_signup_path(@user, @event) but the page > doesnt render with anything i have tried, and i have tried....! > > so far ive tried: > > form_for([@user, @signup]) > form_for([@user, @event]) > form_for([@event, @signup]) > > and everything in between...--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Also, you might want to check Jamis Buck''s post on why 3 deep nested resources may not be a good practice. http://weblog.jamisbuck.org/2007/2/5/nesting-resources On Mar 5, 9:09 am, Thorsten <duple...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 3 levels deep nesting is not nessessary, as the event as parent to the > signup is enough to keep a unique scope on the signup object. > > 1) use these routes: > > map.resources :users do |user| > user.resources :events > end > map.resources :events do |event| > event.resources :signups > end > > 2) and this form defintion: > form_for([@event, @signup]) > > and everything is fine. > > On 5 Mrz., 16:04, betaband <nospacesallonew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have a > > > :user has_many :events has_many :signups > > > map.resources :users do |user| > > user.resources :events do |event| > > event.resources :signups > > end > > end > > > But in the 3rd nested resource im having trouble with the form_for( ) > > function. > > The link to the page where the form lies works and i linked to it > > with: new_user_event_signup_path(@user, @event) but the page > > doesnt render with anything i have tried, and i have tried....! > > > so far ive tried: > > > form_for([@user, @signup]) > > form_for([@user, @event]) > > form_for([@event, @signup]) > > > and everything in between...--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks! It workus! On Mar 5, 4:39 pm, Fred <lee.fre...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Also, you might want to check Jamis Buck''s post on why 3 deep nested > resources may not be a good practice. > > http://weblog.jamisbuck.org/2007/2/5/nesting-resources > > On Mar 5, 9:09 am, Thorsten <duple...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > 3 levels deep nesting is not nessessary, as the event as parent to the > > signup is enough to keep a unique scope on the signup object. > > > 1) use these routes: > > > map.resources :users do |user| > > user.resources :events > > end > > map.resources :events do |event| > > event.resources :signups > > end > > > 2) and this form defintion: > > form_for([@event, @signup]) > > > and everything is fine. > > > On 5 Mrz., 16:04, betaband <nospacesallonew...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I have a > > > > :user has_many :events has_many :signups > > > > map.resources :users do |user| > > > user.resources :events do |event| > > > event.resources :signups > > > end > > > end > > > > But in the 3rd nested resource im having trouble with the form_for( ) > > > function. > > > The link to the page where the form lies works and i linked to it > > > with: new_user_event_signup_path(@user, @event) but the page > > > doesnt render with anything i have tried, and i have tried....! > > > > so far ive tried: > > > > form_for([@user, @signup]) > > > form_for([@user, @event]) > > > form_for([@event, @signup]) > > > > and everything in between...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---