Commit 350b1b51 authored by Leo Benkel's avatar Leo Benkel

Merge branch 'master' of gmailid:wonay/async_data_fetch

parents 55749deb f4df34cf
......@@ -8,29 +8,29 @@ This project uses MIT-LICENSE.
=== In your gemfile
gem 'async_data_fetch'
gem 'async_data_fetch'
=== In application.js
//= require async_data_fetch
//= require async_data_fetch
=== In your models:
acts_as_async :METHOD, :METHOD2, ...
acts_as_async :METHOD, :METHOD2, ...
You need to explicitely list the methods you want to be available, for security reasons.
=== In your views, user the helper:
=== In your views, use the helper:
fetch_async(model_name: "MODEL_NAME", model_id: N , model_method: "METHOD_NAME", tag: "TAG", display_error: [true/false], placeholder: "Loading...", extra_classes: "class1 class2 ")
<%= 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"
- *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: ""
- *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: ' '
---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment