I have a controller with the default functions index, edit, update…etc
but i want to add another route calculator.
my current setup:
compounds_controller.rb
def index
…
def calculator
…
end
i also added views/compounds/calculator.html.erb
i have the default entry in the routes:
map.resources :compounds
how can i get it to map to http://localhost/compounds/calculator ?
i tried doing:
map.calculator ‘/compounds/calculator’, :controller => ‘compounds’,
:action => ‘calculator’
but it’s not working.
i tried reading through some of the routes documentation but was getting
a little confused.