I have just created a controller using the command:
rails generate controller LegacyPlanCalculator index process
and then I added this to my routes.rb file:
match "legacy_plan_calculator" => "legacy_plan_calculator#index"
match "/legacy_plan_calculator/process" => "legacy_plan_calculator#process"
I can see the controller and its views in the project. The actions in the controller are empty obviously:
class LegacyPlanCalculatorController < ApplicationController
def index
end
def process
end
end
But when I try to goto: http://localhost:3000/legacy_plan_calculator I get this error:
wrong number of arguments (1 for 0)
Rails.root: C:/Users/saadr/Dropbox/workspace/gps4money
I want to be able to land on the index view of the legacy plan calculator when the user puts in localhost:3000/legacy_plan_calculator
UPDATE: Here are the first few lines from ‘Full Trace’ on the error page:
actionpack (3.1.0) lib/action_controller/metal.rb:193:in `process'
actionpack (3.1.0) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.0) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.0) lib/action_controller/metal.rb:236:in `action'
actionpack (3.1.0) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.0) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.0) lib/action_dispatch/routing/route_set.rb:29:in `call'
And I don’t know where these files are located so can’t post relevant code from these files.
processis a reserved word, just change it to any other and it will work.