This is my first rails project and first rails post, so I might have trouble expressing myself. I’ve looked around but couldn’t find the answer to something I figured would be simple.
The problem is that I have a rails app that presents a button to the user, and the form action has a complete path starting with http://, even when the user is using SSL, so if they click the button they see a silly warning about the data being unencryped. I want the form action URL to start with /… Here’s the code (HAML) that generates the button:
%li= button_to "Pay by Mail", mail_in_payment_new_org_contact_student_application_app_fee_payment_url(@org, current_user.contact, current_application), :method => "get"
Unfortunately, I’m diving into a project and a language with which I am unfamiliar, I’ve also never seen HAML before. I don’t understand completely this resource: mail_in_payment_new_org_contact_student_application_app_fee_payment, nor do I understand how rails generates the URL based on it.
Any info would be really helpful.
Thank you very much.
Use
mail_in_payment_new_org_contact_student_application_app_fee_payment_pathinstead of
mail_in_payment_new_org_contact_student_application_app_fee_payment_urlIn short, the _url helper is absolute, _path is relative. You can read about them here. If you post the contents of config/routes.rb then I’ll take a stab at explaining what that helper method is composed of.