# :action Problem

**URL:** <https://www.ruby-forum.com/t/action-problem/110376>\
**Category:** Rails\
**Created:** [July 25, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/action-problem/110376 "2007-07-25T21:39:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![turnkeytraders](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ba8739/32.png) [@turnkeytraders](https://www.ruby-forum.com/u/turnkeytraders)\
**Post date:** [July 25, 2007, 9:39pm UTC](https://www.ruby-forum.com/t/action-problem/110376/1 "2007-07-25T21:39:36Z")

</div>

Hello,

I am trying to create a new message in my application and when I click  
on the submit button to create the new message, I get redirected to the  
form to create a new message. Here is my code:

class MessageController \< ApplicationController  
before\_filter :logged\_in?

def new  
@message = Message.new  
end

def create  
@message = Message.new(params[:message])

```
if @message.save
  flash[:notice] = 'Message sent successfully!'
  redirect_to :controller => 'client', :action => 'show', :id =>

```

session[:client]  
else  
render :text =\> ‘Something invalid!’  
end  
end

end

Here is my .rhtml file:

 New Message 

**Subject:**

**Message:**

Thanks  
M.
