Ruby on Rails
Thursday, November 29, 2012
I have a form_tag written like this :
= form_tag search_backoffice_places_path, {:remote =>"true", :id => :searchplaceForm } do
.. input fields
= submit_tag t(:search)
generated html is correct :
<form accept-charset="UTF-8" action="/en/backoffice/places/search" data-remote="true" id="searchplaceForm" method="post">
... input fields
<input id="searchplace" name="commit" type="submit" value="Search" />
</form>
upon submit, params received in backoffice/places_controller#search
{"utf8"=>"✓", "country"=>"United", "city"=>"*", "street_address"=>"*", "wording"=>"*", "commit"=>"Search", "action"=>"search", "controller"=>"backoffice/places", "locale"=>"en"}
backoffice/places_controller.rb
respond_to :html, :js
..
def search
... params received
@places = Place.in_country_like(@country).in_city_like(@city)...... # @places found 1
respond_to do |format|
format.html { render :index }
format.js { } <= should render search.js.erb BUT not ...
end
end
what's could be wrong ? thanks for feedback ( using asset pipeline )
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/V9FLq_7zJBUJ.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment