Forum: Ruby on Rails Data is not passing from Form to controller actions

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Vaibhav D. (Guest)
on 2009-04-09 15:26
How to render the data from form to controller actions?

This is my controller:-

class ViewController < ApplicationController
  def index

  def new


Index Page:-

<form method='post'action='view/new' >
  <input type="text" name="txt">
  <input type="submit">

New Page:-

<p>Find me in app/views/view/new.html.erb</p>
<h2>Hello <%= @txt %></h2>
<%= link_to 'index','index' %>

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

ActionController::InvalidAuthenticityToken in ViewController#new
RAILS_ROOT: D:/projectNetBean/validation
Gavin (Guest)
on 2009-04-09 15:55
(Received via mailing list)
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-
This topic is locked and can not be replied to.