helloqidi
helloqidi · 共 9 篇文章
beast学习笔记——7,forums/index.html.erb——结束篇
beast学习笔记——7,forums/index.html.erb——结束篇 1 (1)代码 <% content_for :right do %> ...... <% end %> (2)表示 已在上一节解释过了。 2 (1)代码 number_with_delimiter(current_site.topics.size) (2)表示 number_with_delimiter,view的辅助方法,用于格式化数字,例如: <%=number_with_delimiter(12345678)%> =>12,345,678 3 (1)代码 <% if recent_forum_activi…
2010-12-22 16:40 · ROR · 评论(0)
beast学习笔记——6,application.html.erb
beast学习笔记——6,application.html.erb 1/此模版的整体布局: <div id="header"></div> <div id="container"> <div id="content"></div> <div id="right"></div> </div> <div id="footer"></div> 2 (1)代码 <%= render :partial => "layouts/head" %> (2)表示 render引用局部模版 3 (1)代码 <%= content_tag 'p', h(flash[:notice]), :class => 'no…
2010-12-22 16:39 · ROR · 评论(0)
beast学习笔记——5,_head.html.erb
beast学习笔记——5,_head.html.erb 参考: http://ihower.tw/blog/archives/3949 http://guides.ruby.tw/rails3/i18n.html 、 http://apidock.com/rails 1, (1)代码 <title> <%=h @current_site && current_site.name || I18n.t('txt.beast_title', :default => 'Altered Beast') %> <%= " - #{h @page_title}" if @page_title %> </t…
2010-12-22 16:38 · ROR · 评论(0)
beast学习笔记——4,enviroment.rb
beast学习笔记——4,enviroment.rb 参考: http://my.oschina.net/fireflyman/blog/4255 http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies 总:每当你启动一个进程(例如Webrick服务器)处理Rails请求的时候,第一件发生的事情就是加载config/enviroment.rb 1, (1)代码 # Be sure to restart your server when you modify this file (2)表…
2010-12-22 16:37 · ROR · 评论(0)
beast学习笔记——3,application_controller
beast学习笔记——3,application_controller 参考 http://www.iteye.com/topic/78885 、 http://blog.csdn.net/jlaky/archive/2008/11/26/3378635.aspx (及其重要的学习资源) http://2015.iteye.com/blog/604377 (关于 CSRF跨站请求伪造与protect_from_forgery**)** http://blog.ashchan.com/archive/2008/11/24/rails-i18n-activerecord-model-human-…
2010-12-22 16:36 · ROR · 评论(0)
beast学习笔记——2,forums_controller
beast学习笔记——2,forums_controller 参考 http://www.iteye.com/topic/78885 、 http://hi.baidu.com/haifreeidea/blog/item/c1a830ef2a92ee212cf534f0.html/cmtid/fd826e81a913b9d99023d95c 1, (1)代码: before_filter :admin_required, :except => [:index, :show] (2)表示: 前置过滤器,对index,show方法除外 (3)其他: admin_required方法存储在哪里?在…
2010-12-22 16:30 · ROR · 评论(0)
beast学习笔记——1,routs.rb
(原稿)beast学习笔记——1,routs.rb 参考 http://www.iteye.com/topic/78885 、 http://hi.baidu.com/haifreeidea/blog/item/c1a830ef2a92ee212cf534f0.html/cmtid/fd826e81a913b9d99023d95c 1, (1)代码 map.root :controller => 'forums', :action => 'index' (2)表示 首页的转向 (3)其他 REST与非REST的routs不同 【1】REST通过ruby script/generate sca…
2010-12-20 14:19 · ROR · 评论(1)
beast学习笔记——开篇
beast学习笔记——开篇 从这篇开始,我想记录下我学习开源REST项目Beast的经过。 我的源码是从 https://github.com/courtenay/altered_beast 下载的,Beast项目在Windwos下运行的步骤已在上篇文章中写明,此源码的最后编辑备注为“August 07, 2009, Rename some rhtml files ”。 我的这些笔记会不断更新,毕竟随着学习内容的增多,某些认识会是错的。 期望我可以坚持学完beast,阿门! 学习Beast之前,建议先找一本《Web开发敏捷之道》学习一下,然后看看《应用Rails 进行REST 开发》电子书(…
2010-12-20 14:17 · ROR · 评论(0)
在 Windows下安装altered_beast
(原稿)在 Windows下安装开源REST项目altered_beast 一、安装ruby,rubygems,rails 参考:http://www.rubyonrailscn.org/down/ 1,下载并安装Ruby 1.8.7。 (注:altered_beast需要rails 2.3.3,而rails 2.3.3又至少需要Ruby 1.8.7) 2,下载rubygems-1.3.7,进入下载目录后通过命令ruby setup.rb来安装。 3,安装Rails。通过执行:gem install rails 2.3.3来安装 4,rails项目测试: rails test cd test…
2010-12-04 00:40 · ROR · 评论(0)