** adding a post - status update**

Hi All,

I am trying to implement a status update to be used on my web application.

The tutorial I had followed suggested to do the following:

Create a model called post with message:text Then rake db:migrate (so far so good – db shows new table ‘posts’)

I then need to create a controller called post

Within this there is then an index and create methods

I add the relevant view information to the views/posts directory and all works fine.

The problem I have is, I really want this within my existing user profile page (where a user would update their account)

To alter this, is it just a case of adding the methods to the user_controller, and subsequent view files to the user’s view directory?

As it stands, I can get the view to display nicely in the user’s profile/update area, but when I hit post, I’m taken to localhost/posts – which doesn't look too great. What I need is for this to remain in the user profile area.

Any ideas?

I’m not sure what you are trying to do here. When you say status update, I assume you are talking about a twitter-like status as opposed to system-wide status. You should keep the status related operations in the status controller. For example, if you wanted to add a status from the user view, you can have the form on the show user page, and have the form post to the post_controller, then redirect back to the user show. Better yet, you can make it an AJAX call.

In sort, keep the controller, but you can probably ditch the views (or move the code to the user views).

Darian Shimy

Cool - cheers...

I'll try it that way.