• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dmarkow/jquery-mobile-rails: jQuery Mobile for Rails 3/4 Asset Pipeline

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

dmarkow/jquery-mobile-rails

开源软件地址(OpenSource Url):

https://github.com/dmarkow/jquery-mobile-rails

开源编程语言(OpenSource Language):

Ruby 94.5%

开源软件介绍(OpenSource Introduction):

jQuery Mobile for Rails

This gem adds the jQuery Mobile files to Rails' asset pipeline.

Gem's jQuery Mobile Version

1.4.5 (gem 1.4.5)

Installation

Add this gem to your Gemfile:

gem 'jquery_mobile_rails'

This will add jQuery Mobile's javascripts, stylesheets and images to your app. It will also set up the asset pipeline to precompile these assets for production.

Include jquery.mobile (or jquery.mobile.min) in your application.js manifest:

//= require jquery
//= require jquery_ujs
//= require jquery.mobile

And the same in your application.css manifest:

*= require_self
*= require_tree .
*= require jquery.mobile

NOTE: You should probably remove Turbolinks from your application.js manifest, as it likely won't work well with jQuery Mobile.

Use

I built this gem for using with the Mobylette gem, but it will work with your standalone application, or with any other gem that filters your mobile requests.

Please refer to jQuery Mobile's documentation for information on laying out your app and using all of the jQuery Mobile features.

Example

There is a very simple application inside test/dummy demonstrating basic usage of jQuery Mobile templating.

Versioning

jQuery Mobile Rails' gem versions will align with jQuery Mobile's version numbering, with the most recent gem always providing the current stable release of jQuery Mobile.

To use an older version, please be sure to reference the proper gem version in your Gemfile. For example, to use 1.3.2:

gem "jquery_mobile_rails", "1.3.2"

Pull Requests

Please make sure to follow these steps before submitting any pull requests:

  • Copy jQuery Mobile files to vendor/assets/(javascripts|stylesheets|images)/
  • Remove version number from the filenames
  • Run bundle exec rake jquery_mobile_rails_css_fix. This will convert the css files to scss and ensure that the image references will properly use Rails' asset pipeline (by using image-url instead of url).

References

Authors




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap