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

  • SEARCH
  • Home
  • 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 8516757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:31:11+00:00 2026-06-11T05:31:11+00:00

I have a Rails 3 inhouse application which is used on: 19 touch screen,

  • 0

I have a Rails 3 inhouse application which is used on:
19″ touch screen, 10″ iPads, 7″ Tablet

I am using will_paginate / kaminari for displaying lists of data.

But how can I configure how many items per page it should display depending on the screen size?

e.g. 20 lines for a 19″ display, 11 lines for a 10″ display, 8 lines for a 7″ display

  • 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-11T05:31:12+00:00Added an answer on June 11, 2026 at 5:31 am

    You might consider on the first request to your application passing via Ajax the relevant navigator and/or screen information and using that information to decide on the backend in Rails.

    To get browser/OS information, see Javascript’s navigator object and to get information about the screen dimensions, check Javascript’s screen object.

    Your Ajax controller action could store JSON versions of the navigator/screen information to session and a before_filter in ApplicationController could be used to set @per_page for use throughout your application’s paginators.

    before_filter do
      @per_page = 11 if !session[:navigator][:userAgent].match(/iPad/).nil?
      @per_page = 8  if !session[:navigator][:userAgent].match(/Android/).nil? && session[:screen][:width] < 1000
      # ...
    end
    

    You’d then pass @per_page to kaminari’s pager.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have rails applications, which communicate with each other using ActiveResource. I have setup
I have Rails application (Redmine) and I have created next working code which close
I have Rails application with mounted Engine. #{main_app}/config/routes.rb mount CommentIt::Engine => /talk, :as =>
I have rails application running in linode server .Some guy is continuously spamming (writing
I have rails app which are working perfectly in the local computer. But when
I just started using CakePHP for a small project. I have rails experience, and
I have rails 3.1.3 and formtastic 2.0.2. I'm using the most basic form you
I have rails app which has a list of users. I have different relations
I have rails application that calculates prices of goods and I set prices in
I have a Rails application that unfortunately after a request to a controller, has

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.