1

I am new to Rails, and I am learning to bare with it.

I have a user model

has_many :branches, :dependent => :destroy has_many :comments, :dependent => :destroy

and it has a field profile_type

on the view I am doing this

  <%= search_form_for @search , url: news_path do |f| %>

    <%= f.select :profile_type_eq, [['Doctors', 1], ['Professors', 0], ['Teachers', 2]],
                 include_blank: "All Account Types" %>
    <%= f.submit 'Filter Accounts'%>

<% end %>

I need to be able to add another drop down and another button to filter example profile type doctors with most comments or with most branches. How can I do that with ransack?

1 Answer 1

0

I think it is not possible at all, like it is not possible to search through has_one associations

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.