# Data is not passing from Form to controller actions

**URL:** <https://www.ruby-forum.com/t/data-is-not-passing-from-form-to-controller-actions/165134>\
**Category:** Rails\
**Created:** [April 9, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/data-is-not-passing-from-form-to-controller-actions/165134 "2009-04-09T13:26:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav\_darji](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a4c791/32.png) [@vaibhav\_darji](https://www.ruby-forum.com/u/vaibhav_darji)\
**Post date:** [April 9, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/data-is-not-passing-from-form-to-controller-actions/165134/1 "2009-04-09T13:26:00Z")

</div>

How to render the data from form to controller actions?

This is my controller:-

class ViewController \< ApplicationController  
def index  
end

def new  
@txt=params[:txt]  
end

end

Index Page:-

New Page:-

# View#new

Find me in app/views/view/new.html.erb

## Hello \<%= @txt %\>
\<%= link\_to 'index','index' %\>

Error after filling text box and cliking the submit button:-

ActionController::InvalidAuthenticityToken in ViewController#new  
ActionController::InvalidAuthenticityToken  
RAILS\_ROOT: D:/projectNetBean/validation

---

<div class="post-metadata">

**Author:** ![vaibhav\_darji](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/a4c791/32.png) [@vaibhav\_darji](https://www.ruby-forum.com/u/vaibhav_darji)\
**Post date:** [April 9, 2009, 1:55pm UTC](https://www.ruby-forum.com/t/data-is-not-passing-from-form-to-controller-actions/165134/2 "2009-04-09T13:55:33Z")

</div>

It looks like you are not passing the authenticity token

Are you using form\_for in the view?

On Apr 9, 12:26 pm, Vaibhav Deshpande \<rails-mailing-l…@andreas-
