[Rails] Re: Quick one! -- Project Messages!!

2009-01-07 Thread Dave Smith
Dave Smith wrote: > >>> - >>> Ryan Bigg >>> Freelancer >>> http://frozenplague.net >> >> Thanks for your help. >> >> Ive created a nested route, and now have my messages for the project >> which is fine. The next problem comes from getting the comments for each >> message in this index pa

[Rails] Re: Quick one! -- Project Messages!!

2009-01-07 Thread Dave Smith
>> - >> Ryan Bigg >> Freelancer >> http://frozenplague.net > > Thanks for your help. > > Ive created a nested route, and now have my messages for the project > which is fine. The next problem comes from getting the comments for each > message in this index page. > > I am not quite sure h

[Rails] Re: Quick one! -- Project Messages!!

2009-01-06 Thread Dave Smith
Ryan Bigg wrote: > Woah. > > Firstly, why are you calling .collect on project.messages and > everything? This is unnecessary. > > Secondly, if messages is an association for a project it would be > better if you used nested routes, as explained here: > http://guides.rails.info/routing_outside_i

[Rails] Re: Quick one! -- Project Messages!!

2009-01-06 Thread Sazima
Ryan, If I understood correctly, he already has an index action that shows truncated messages. He asked for a 2nd page to show the whole content of all messages. He would probably be better off using a nested route for only 1 action (index) and retrieving the rest of the message asynchronously w

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Ryan Bigg
Woah. Firstly, why are you calling .collect on project.messages and everything? This is unnecessary. Secondly, if messages is an association for a project it would be better if you used nested routes, as explained here: http://guides.rails.info/routing_outside_in.html . Your controller wou

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Sazima wrote: > 1. Route (config/routes.rb): > > map.with_options(:controller => 'messages') do |m| > m.messages '/messages', :action => 'messages' > end > > 2. Action (app/controllers/messages_controller.rb): > > def messages > # Retrieve messages the same way you did in the ind

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Sazima
1. Route (config/routes.rb): map.with_options(:controller => 'messages') do |m| m.messages '/messages', :action => 'messages' end 2. Action (app/controllers/messages_controller.rb): def messages # Retrieve messages the same way you did in the index action end 3. View (app/view

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Sazima wrote: > If this 2nd page you want will contain only 1 message, then it is the > standard show action + view... Otherwise you can add a named route and > use whatever name you want for the action and view. But it can be > trickier to add comments. > > Cheers, Sazima > > On Jan 5, 3:05�pm,

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Sazima
If this 2nd page you want will contain only 1 message, then it is the standard show action + view... Otherwise you can add a named route and use whatever name you want for the action and view. But it can be trickier to add comments. Cheers, Sazima On Jan 5, 3:05 pm, Dave Smith wrote: > Sazima w

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Sazima wrote: > Do you want the second page to contain all the messages or just 1 > message? > > Cheers, Sazima > > On Jan 5, 8:40�am, Dave Smith ? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscr

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Dave Smith wrote: > Sazima wrote: >> Do you want the second page to contain all the messages or just 1 >> message? >> >> Cheers, Sazima >> >> On Jan 5, 8:40�am, Dave Smith > > all the messages for a particular project, and then a section under for > comments to be made for each message (kind

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Sazima wrote: > Do you want the second page to contain all the messages or just 1 > message? > > Cheers, Sazima > > On Jan 5, 8:40�am, Dave Smith all the messages for a particular project, and then a section under for comments to be made for each message (kind of indented if you know what i

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Sazima
Do you want the second page to contain all the messages or just 1 message? Cheers, Sazima On Jan 5, 8:40 am, Dave Smith wrote: > Hi Guys, > > The answer to this is probably pretty simple but I have an app which > holds projects, and have messages for each project. > > project has_many messages

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
Bobnation wrote: > What did you name the method in your project controller? > > On Jan 5, 5:40�am, Dave Smith Hi, Im not sure if I am going about this the right way but, ive created a partial called _message in the project view with the following link; ---

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Bobnation
What did you name the method in your project controller? On Jan 5, 5:40 am, Dave Smith wrote: > > In my project view page you can see the messages (but they are truncated > > to save space). I want to have a "more" link that takes the user to > > another page which holds all the full project mes

[Rails] Re: Quick one! -- Project Messages!!

2009-01-05 Thread Dave Smith
> In my project view page you can see the messages (but they are truncated > to save space). I want to have a "more" link that takes the user to > another page which holds all the full project messages. > > Do I create a page called messages.html.erb? > > I would also like to be able to comment