I am new to ruby and one of the things on my page I am trying to do is take input from user and on button click want to make a call to the method for processing.
The controller looks like
def index //code end def create //code end def doSomeAction //This is where I want to process end This is the view
<%= form_tag(project_path, multipart: true, class: 'form-inline', role: 'form') do %> <%= button_tag 'upload batch file', class: 'btn btn-primary' %> <%= link_to 'Reports Index', reports_path %> <% end %> <%= text_field "item", "ids", "size" => 20 %> <%= button_to 'Call Action', method: "doActionTest" %> This is the routes
Rails.application.routes.draw do resources :browse_items, only: [:index, :show] resources :reports, only: [:index, :show] resources :project, only: [:index, :create, :show] root to: "project#index" end How to map the button to doActionTest and how to pass value from the text field to that method ?