Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9215569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:13:58+00:00 2026-06-18T02:13:58+00:00

Another one from the SaaS class after quite some trial and only error. There’s

  • 0

Another one from the SaaS class after quite some trial and only error. There’s a table with movies that can be filtered (by checking boxes) and sorted by ratings (by clicking on theader). If filtered, subsequent sorting should preserve the filter.

I guess the request triggered by ‘link_to’ should include the ‘ratings’ parameters in the _path() so the controller can query and submit to view accordingly.

If that’s right – how do I get the check_box_tag values in the movies_path()? If not, what else should I do? Thanks in advance!

%h1 All Movies
=puts 'Ratings: ', params[:ratings].nil?
= form_tag movies_path, :id => 'ratings_form', :method => :get do
  Include:
  - @all_ratings.each do |rating|
    = rating
    = check_box_tag "ratings[#{rating}]", 1, @filtered_ratings.include?(rating) ? true : false
  = submit_tag 'Refresh', :id => 'ratings_submit'

%table#movies
  %thead
    %tr
      %th{:class => @title_header}= link_to "Movie Title", movies_path(:sort => "title"), :id => 'title_header'
      %th Rating
      %th{:class => @date_header}= link_to "Release Date", movies_path(:sort => "release_date"), :id=> 'release_date_header'
      %th More Info
  %tbody
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:13:59+00:00Added an answer on June 18, 2026 at 2:13 am

    So I learnt that one can simply add elements from params[] to the _path() so that these show up in the URL separated by ?. Hope this will be useful for other fellow beginners..

      %thead
        %tr
          %th{:class => @title_header}= link_to "Movie Title", movies_path(:sort => "title", :ratings => params[:ratings]), :id => 'title_header'
          %th Rating
          %th{:class => @date_header}= link_to "Release Date", movies_path(:sort => "release_date", :ratings => params[:ratings]), :id=> 'release_date_header'
          %th More Info
      %tbody
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have recently moved some data from an SQL Database instance to another one
Liferay migration from one server to another help required. Can anyone share there steps
After I migrate my Magento shop from one hosting provider to another one. Before
I know there are many questions involving Huffman Code, including another one from myself,
Create an instance from another one of different kind/class. Quick example: you are using
I am really struggling with with passing variables from one class to another. I
I am trying To Move Some Data From One Activity To another one. Using
I want to position two buttons away from one another in a TableRow.. but
I am using server.transfer to redirect from one to another page... lets say when
Possible Duplicate: How to Pass String to another forms from one form in c#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.