Skip to content

Instantly share code, notes, and snippets.

@cnruby
cnruby / info_zurb_foundation-rails
Last active August 29, 2015 14:01
info zurb foundation-rails
ZURB foundation
* 是前端框架
* 是基于SASS
* Sass是基于Ruby语言
foundation-rails软件包
* 将ZURB foundation与Rails框架集成为一体
前提条件
* Ruby 2.0.0
@cnruby
cnruby / best_ebooks_creator_mac.txt
Last active August 29, 2015 14:01
best ebooks creator mac
http://www.jedisaber.com/eBooks/editors.shtml
https://code.google.com/p/sigil/
http://www.jedisaber.com/eBooks/Sigil01.shtml
http://bewonderfulnow.com/book-writing-coaching/sigil-walkthrough-how-to-create-your-own-ebook/
@cnruby
cnruby / plain-clip.txt
Last active August 29, 2015 14:01
mac os x copy plain freeware plain-clip
http://www.bluem.net/de/mac/plain-clip/
http://superuser.com/questions/512491/copy-and-paste-plain-text-only-in-osx
@cnruby
cnruby / command_vagrant_up_failed
Last active August 29, 2015 14:01
《???》软件Vagrant命令vagrant up无法使用
<问题>
命令vagrant up无法使用,出现下面<错误>。
<方案>
(1)在VirtualBox重新打开Ubuntu,关闭时,使操作系统处于‘saved’状态;
(2)使用命令vagrant up
(3)再使用命令vagrant reload
<错误>
$ vagrant up
@cnruby
cnruby / gist:75727327b3a563160b42
Last active August 29, 2015 14:01
《?》Rails应用程序跨站请求伪造(CSRF)攻击错误信息
<问题说明>
当执行Rails应用程序更新功能时,在浏览器Stainless中,会出现下面<错误信息>。
<解决方案>
vim application_controller.rb
#protect_from_forgery with: :null_session
protect_from_forgery # Same as above
<错误信息>
@cnruby
cnruby / nokogiri_on_ubuntu.txt
Last active August 29, 2015 14:01
nokogiri on ubuntu 12.04
git clone https://github.com/sparklemotion/nokogiri.git
cd nokogiri
bundle install
rake native gem
cd pkg
gem install nokogiri-<VERSION>-x86_64-linux.gem
# reinstall nokogiri
gem install nokogiri -- --use-system-libraries
@cnruby
cnruby / robomongo_tool.txt
Created June 2, 2014 09:17
《.^.》Shell-centric cross-platform MongoDB management tool
http://robomongo.org/
@cnruby
cnruby / iterm2_tool.txt
Created June 2, 2014 09:20
《.^.》iTerm2 is a terminal emulator for Mac OS X that does amazing things.
http://www.iterm2.com/
@cnruby
cnruby / capybara_info.txt
Last active August 29, 2015 14:02
《.°.》Ruby, Rails and Capybara
http://learn.thoughtbot.com/test-driven-rails-resources/capybara.pdf
https://www.relishapp.com/rspec/rspec-rails/docs/feature-specs/feature-spec
http://robots.thoughtbot.com/rspec-integration-tests-with-capybara
http://larsgebhardt.de/user-authentication-with-ruby-on-rails-rspec-and-capybara/
http://blog.berylliumwork.com/2013/07/rails-4-devise-3-minitest-and-capybara.html
@cnruby
cnruby / rails_welcome_aboard.txt
Created June 6, 2014 20:47
《??》Where is the default “Welcome Aboard” page located in my app?
Since Rails 4, the "Welcome aboard" page is no longer located in public/index.html. It is - as you've already detected - located inside one of the Rails gems.
So you already answered the question yourself; the "Welcome aboard" page is - in your case - located at /Users/7stud/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/gems/railties-4.0.0/lib/rails/templates/rails/welcome/index.html.erb
To get rid of it, following the instructions on the page. Basically they are:
Create a controller
Add a root route in config/routes.rb to route to that newly created controller.
As for how the request to your application ends up at a controller inside railties, let's dig into the gem: Inside Rails::Application::Finisher we find this: