搭建rails+passenger+nginx开发环境
wget ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
tar -zxvf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
./configure --prefix=/usr/local/ruby-1.9.2-p180
make
sudo make install
export PATH=/usr/local/ruby-1.9.2-p180/bin:$PATH
echo export PATH=/usr/local/ruby-1.9.2-p180/bin:$PATH >> ~/.profile
sudo gem i passenger
sudo passenger-install-nginx-module
sudo gem i rails
sudo gem i sqlite3
rails new demo -d sqlite3
http://charlescui.iteye.com/blog/1026876
http://charlescui.iteye.com/blog/1026876
我现在略懂routes.rb了, 我已经可以熟练使用resources,namespace以及scope了,我要买瓶拉费庆祝一下!
我觉得subresource这概念的推出很是失败,它不建议大家使用多于一层的资源嵌套,那仅有的一层资源嵌套又有什么意义呢?不如不用subresource。
同意,resources语法太难用了,再配上不知所谓的 :as 选项就彻底傻了。
用 rvm 装 ruby 吧,你这样很容易缺这缺那的。 服务器推荐 unicorn ⋯⋯ 虽然还有很多人喜欢 passenger ⋯⋯ 不要手动安装 rails 和 bundler 以外的 gem,用 bundler,改 Gemfile 就行了。
另外,我觉得 rails 3 路由配置最好直接用 get, post, put, delete 等方法 ⋯⋯
账户体系打通了openid,oauth,可以登录google和facebook以及twitter
If the controller name begins with a slash no defaults are used: url_for :controller => '/home' In particular, a leading slash ensures no namespace is assumed. Thus, while url_for :controller => 'users' may resolve to Admin::UsersController if the current controller lives under that module, url_for :controller => '/users' ensures you link to ::UsersController no matter what.
MLGB的,rails的路由使用了namespace后就变得丑陋了!哦shxt!!!
ubuntu上编译ruby-debug19失败后的解决方法: apt-get install ruby-dev gem install ruby-debug19 -- --with-ruby-include=ruby源码路径
Phusion Passenger users guide, Nginx version
http://www.modrails.com/documentation/Users%20guide%20Nginx.html
rails路由: http://inosin.iteye.com/blog/786467