I was defining an instance variable @url in the controller. Also, I was using a simple form_for tag in the view.
CONTROLLER:
class SomeController < ApplicationController
def some_method
#some logic
@url = URL_STRING
end
end
VIEW:
- form_for :some_object, :url => @url do |f|
- #some form fields
= submit_tag 'submit'
Everything seemed normal. But, I started getting this weird error. After a bit of search, I came to know that link_to, url_for and similar method uses ActionController::Base @url instance variable to generate URLs. So, make sure that you don't use/define @url anywhere in your controllers/helpers.
No comments:
Post a Comment