简体   繁体   中英

Rails' form_for_filterrific doesn't work in production env (but works in dev. env)

I'm using filterrific 4.0.0 (but I also tried 4.0.1 and 2.0.5) in rails 4.2.10 and ruby 2.3.0 and all filterrific's options (which I use) work for me correctly in development environment (eg filterrific_sorting_link or form_for_filterrific). Unfortunately all form_for_filterrific with "select" (example below) don't work in production environment (filterrific_sorting_links are OK). There is one (observed by me) an exception when these "selects" work in production environment - when I am redirected by some other (POST action) form (in controller by rails [action "create"]) to the page with these "selects". But when I simply render all my pages with these "selects" these buttons don't work at all - nothing happens after clicking at them.

Maybe it is something with asset pipeline (this is a major difference between these two environments - I had in the past some troubles with application.js when something using jQuery was working in dev. and wasn't working in prod. env.)? Should maybe something be added there related to filteriffic?

<%= form_for_filterrific @filterrific do |f| %>
    <div>
        <%= f.select(:with_player_club, 
            @filterrific.select_options[:with_player_club],
            { include_blank: t('all_teams') }, class: 'form-control') %>
    </div>
    <%= render_filterrific_spinner %>
<% end %>

Thank you in advance for any help. Regards!

I did all necessary production stuff once again (including precompilation) and... everything works now.

I think that before something went wrong with precompilation of filterrific's spinner which is being triggered when "selects" are used.

Repeat precompilation - this is the answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM