Trying to use link_to to send info to action in my controller.
Link looks like this:
<%= link_to "Buy", {:controller => :policies, :action => :policy_option_price_calc, :option => "policy_option_a_cost" }, {:method => :post} %>
I have a policies controller and inside my action looks like this:
def policy_option_price_calc(params)
#logic stuff
render :partial => "/policies/swipe_protect/price_total"
end
and in my routes I have:
resources :policies
member do
post 'policy_option_price_calc'
end
end
I don't know why but I am getting this url when clicking the link_to link:
http://localhost:3000/?action=policy_option_price_calc&controller=policies&option=policy_option_a_cost
Which of course doesn't exist, but its not even giving me an error its just being processed by my HomeControll#index
I have looked at:
Plus many more. Any help would be appreciated, thanks.