Bobnation wrote:
> What did you name the method in your project controller?
>
> On Jan 5, 5:40�am, Dave Smith <[email protected]>
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;
--------------------------------------------------------------------------
<% for message in @project_messages %>
<%= render :partial => "message", :object => message %>
<% end %>
--------------------------------------------------------------------------
and the following code in the _message partial.
----------------------------------------------------------------------------
<table>
<tr>
<th><%= message.status %> - <%= message.title %></th>
</tr>
<tr>
<td><%= truncate(message.body, 60, "...") %> <%= link_to
'continue...', message_path(@project) %></td>
</tr>
</table>
This works to view the messages within the project view page.
But I want to be able to view all the messages for a project in thier
entirety on a different page and create comments for each message...
My Projects controller show def currently looks like this;
def show
@project = Project.find(params[:id])
@project_tasks = @project.tasks.collect
@project_messages = @project.messages.collect
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @project }
end
end
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---