🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

async_data_fetch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async_data_fetch

0.0.12
Rubygems
Version published
Maintainers
1
Created
Source

= AsyncDataFetch

This project uses MIT-LICENSE.

== To use:

=== In your gemfile

gem 'async_data_fetch'

=== In application.js

//= require async_data_fetch

=== In your models:

acts_as_async :METHOD, :METHOD2, ...

You need to explicitely list the methods you want to be available, for security reasons.

=== In your views, use the helper:

<%= fetch_async(model_name: 'MODEL_NAME', model_id: N , model_method: 'METHOD_NAME', tag: 'TAG', display_error: false, placeholder: 'Loading...', extra_classes: 'class1 class2 ') %>

  • model_name is the name of your model you want to fetch data from
  • model_id is the id of the row
  • model_method is the method you want to call
  • tag is the wrapper tag. Default: 'span'
  • display_error is for debug, you'll see more information into the html and into the javascript console. Default: false
  • placeholder is the text which will be there while the data is being fetch. Default: '?'
  • extra_classes is to add more classes to the tag. Default: ' '

== TODO:

  • make the controller test work. I am having issues with routing if someone wants to help me.
  • make the readme looks better. Sorry for now. If you can help, let me know !

FAQs

Package last updated on 25 May 2016

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