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 would be called messages_controller and the action  
would be called index, not messages.
-----
Ryan Bigg
Freelancer
http://frozenplague.net







On 06/01/2009, at 6:02 AM, Dave Smith wrote:

>
> 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 index action
>>  end
>>
>> 3. View (app/views/messages/messages.html.erb) => do the same as in
>> index, but showing the whole message...
>>
>> Cheers, Sazima
>>
>> On Jan 5, 3:20�pm, Dave Smith <rails-mailing-l...@andreas-s.net>
>
> im slightly confused. i was returning the messages in the projects
> controller by doing
>
> @project_messages = @project.messages.collect
>
> -- 
> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to