随笔分类 -  ROR

Rails设置环境变量
摘要:目前接触的环境变量分为2种,这里以sunspot中设置solr url为例1. ENV['SOLR_URL']在Bash中就是系统环境变量,可使用export SOLR_URL=http://localhost:8983/solr进行设置。在ruby里通过ENV['SOLR_URL']可访问相应的系统变量。在Heroku中可使用heroku config:add SOLR_URL=http://localhost:8983/solr设置heroku的环境变量,设置完后,使用heroku config查看是否设置成功。参考文档 : http://devcenter 阅读全文

posted @ 2011-09-20 10:29 sleepingfire 阅读(687) 评论(0) 推荐(0)

sass无法导入
摘要:已定义的sass文件没有被导入,先查看public/sass/_all.sass有没有用@import导入相关sass文件 阅读全文

posted @ 2011-08-07 11:57 sleepingfire 阅读(144) 评论(0) 推荐(0)

named route
摘要:在route.rb里定义路由规则后,会自动生成named routes。例如match '/about', :to => 'pages#about', :as => :about会自动生成named routes (about_path和about_url, 在controllers和views中可用),即定义match '/*',会自动生成*_path和*_url的named routes。about_path => '/about'about_url => 'http://localhost:3 阅读全文

posted @ 2011-08-01 11:25 sleepingfire 阅读(146) 评论(0) 推荐(0)

导航