rails plugin是什么,自己google吧 生成plugin骨架代码: ruby script\generate plugin MyPlugin 功能需求: 在BlogController中把所有符合条件的Post(Model)生成为xml 如果不使用插件,很easy : in BlogController def export_to_xml posts = Post.find(:all, :order => 'published_date', :conditions => ['title = ?', 'love']) send_data posts.t ...
2008-03-10

rails theme(参考typo)

关键字: rails theme 模板
最近学习一下typo,看typo的theme是怎样实现的,顺便把theme模块抽出来,以后编写rails应用(比如Blog),直接把代码COPY进去就可以. 1)修改routes.rb, add以下code: map.with_options(:conditions => {:method => :get}) do |get| get.with_options(:controller => 'themes', :filename => /.*/, :conditions => {:method => :get}) do |theme| theme.connect 'st ...
2008-01-22

使用Acts As Taggable On Steroids定义标签

关键字: acts_as_taggable rails 标签
最近下载一个rails blog应用(Simplelog)并把它里面的acts_as_taggable plugin改为Acts As Taggable On Steroids,因为在rails2.0下总是运行出错. 1.安装 ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids 2.建立数据 生成migration: ruby script/generate acts_as_taggable_migration 生成数据: r ...
2008-01-21

使用Gmail Smtp 发送email (rails2.0)

关键字: actionmailer rails
ActionMailer是一个简单的Rails组件,应用程序可以借助它来收发电子邮件。 Gmail--你必须有一个账号和密码,没有的话快去申请http://mail.google.com/mail/signup 邮件配置: 在enviroment.rb文件中: ActionMailer::Base.server_settings = { :address => "smtp.gmail.com", :port => 587, :authentication => :plain, :user_name=> "gmail­_account", :password ...
kyoleelqh
  • 浏览: 1891 次
  • 性别: Icon_minigender_1
  • 来自: 广东汕头
  • 详细资料
搜索本博客
最近加入圈子
存档
最新评论