Rails 大量使用了符号(symbol)。符号看上去很像变量名,不过以冒号作为前缀。符号的例子包括:action、:line_items、:id 等。可以把符号看作字符串文本,不过——如同魔法般地——被变成了常量。 可以把冒号看作“名字叫做……的东西”,因此:id 的意思就是“名字叫做id 的东西
分类:
其他好文 时间:
2016-02-01 18:38:53
阅读次数:
133
在执行rails 命令时出现: diudiugirl@DIUs:~/ashelf$ rails s /home/diudiugirl/.rvm/gems/ruby-1.9.3-p545/gems/json-1.8.0/lib/json/common.rb:67: [BUG] Segmentation
分类:
Web程序 时间:
2016-02-01 18:33:07
阅读次数:
167
1. RAILS_ENV=production rails s启动服务器 2. RAILS_ENV=production rails generate controller ProductionArray 3. RAILS_ENV=production rails generate migratio
分类:
其他好文 时间:
2016-02-01 18:07:51
阅读次数:
191
一、概述 1. 在Ember Data上以每个实例为基础,records被持久化。在DS.Model的任何一个实例上调用save()并且它将会并且它将产生一个网络请求。 2. 下面是一些例子: var post = store.createRecord('post', { title: 'Rails
分类:
其他好文 时间:
2016-02-01 17:38:41
阅读次数:
166
一、Creating 1. 你可以通过调用在store中的createRecord方法来创建records。 store.createRecord('post', { title: 'Rails is Omakase', body: 'Lorem ipsum' }); 2. 这个store对象可以通
分类:
其他好文 时间:
2016-02-01 15:39:09
阅读次数:
214
diudiugirl@DIUs:/var/www/ashelf$ RAILS_ENV=production rails s Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby binary
分类:
其他好文 时间:
2016-02-01 15:15:35
阅读次数:
409
在执行rails s时出现“`block in replace_gem': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter`”错误: diudiugirl@DIUs:/var/www/ashelf
分类:
数据库 时间:
2016-02-01 15:11:42
阅读次数:
474
在Gemfile文件中添加'bootstrap-sass',再运行bundle install gem 'bootstrap-sass' 在config/application.rb添加一行代码,让bootstrap-sass和asset pipeline兼容 class Application <
分类:
其他好文 时间:
2016-01-31 21:27:45
阅读次数:
269
最近因为一位极光推送朋友,我开始了大概三四天的Rails学习之路,最终达到的水平是可以比较轻松地做出大部分功能,然后自我感觉可以自如地按照Rails的设计思想去思考。
分类:
其他好文 时间:
2016-01-29 20:46:11
阅读次数:
170
转自:http://henter.me/post/ruby-rvm-gem-rake-bundle-rails.html Ruby 这个就不用多说了 RVM 用于帮你安装Ruby环境,帮你管理多个Ruby环境,帮你管理你开发的每个Ruby应用使用机器上哪个Ruby环境。Ruby环境不仅仅是Ruby本
分类:
其他好文 时间:
2016-01-28 21:12:50
阅读次数:
235