Data is not passing from Form to controller actions


#1

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


#2

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-