Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

per_page_loader

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

per_page_loader

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

PerPageLoader

Installation

Add this line to your application's Gemfile:

gem 'per_page_loader'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install per_page_loader

Usage

PerPageLoader lets you attach page specific coffeescript to your rails application using jquery to load the specific coffee class and method that are needed for your controller action.

Setup

After including the gem it is as simple as wrapping your application html in the per_page_container helper method.

%body
  = per_page_container do
    = yield

Adding this helper to the layouts will give PerPageLoader access to loading in javascript for every page.

Generators

The PerPageLoader has a specific format of coffeescript controller that it looks for and we have built generators to help build these files for you.

rails generate per_page_loader:controller User will generate...

# app/assets/javascripts/application/controllers/users_controller.coffee
class UsersController
window.UsersController = UsersController

Auto generating the actions is as easy as passing in the names of the actions.

rails generate per_page_loader:controller User index show will generate...

# app/assets/javascripts/application/controllers/users_controller.coffee
class UsersController

  indexAction: ->

  showAction: ->

window.UsersController = UsersController

If it is necessary to change the location that the file is generated the --dir=dir_name flag can be used.

rails generate per_page_loader:controller User --dir=admin will generate...

# app/assets/javascripts/admin/controllers/users_controller.coffee
class UsersController
window.UsersController = UsersController

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 11 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc