Rails 应用程序的那行代码到底在哪里?哪个文件,是否有任何额外的语法?有没有人有一个完整的例子来说明如何禁用 jQuery 加载消息?我已经阅读了文档,但我认为我缺少一些非常基本的东西,但文档中没有明确涵盖。
谢谢
应用程序.js
//= require jquery
//= require jquery_ujs
//= require jquery.mobile
应用程序.mobile.js
//= require jquery.mobile
应用程序.css
*= require_self
*= require jquery.mobile
*= require scaffolds.css
应用程序.mobile.css
*= require_self
*= require jquery.mobile
宝石文件
source 'http://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'thin'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier'
end
gem 'jquery-rails'
gem 'mobylette'
gem 'jquery_mobile_rails'
group :test, :development do
gem 'rspec'
gem 'rspec-rails'
gem 'sqlite3'
end
应用程序.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Mobile Version!</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<%= javascript_include_tag "application" %>
<script type='text/javascript'>
$.mobile.hidePageLoadingMsg();
</script>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application.mobile.js" %>
<%= stylesheet_link_tag "application.mobile.css" %>
<%= csrf_meta_tags %>
</head>
<body>
<div data-role="page">
<%= yield %>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>
<%= link_to notes_path, :class => ("ui-btn-active" if action_name == 'index'), :"data-icon" => "home", :"data-iconpos" => "top" do %>
Home
<% end %>
</li>
<li>
<%= link_to new_note_path, :class => ("ui-btn-active" if action_name == 'new'), :"data-icon" => "plus", :"data-iconpos" => "top" do %>
New Note
<% end %>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>