天天红玉世界

Rails Ruby Erlang 。。。创新来自于刻苦的实践和勤奋的思考... www.hhtong.com

www.lycom.de

Rails实例世界(No 3):关于Textile的可视化编辑插件textile_toolbar

Gudao Luo2008-11-27 at 11:23发表的

关于Textile的可视化编辑插件textile_toolbar

注:好像Firefox不能够访问上面图的链接,而使用浏览器Safari是可以的。
 
使用关于Textile的可视化插件textile_toolbar方法
rails textile_toolbar_demo && cd textile_toolbar_demo
 
ruby script/plugin install git://github.com/pelargir/textile_toolbar.git
rake textile_toolbar:install
 
ruby script/generate scaffold post title:string body:text published:boolean
 
vi app/views/posts/edit.html.erb
<%#= f.text_area :body %>
<%= f.textile_area :body, :rows => 5, :cols => 20 %>
 
vi app/views/layouts/posts.html.erb
<%= stylesheet_link_tag 'scaffold' %>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag "textile_toolbar.js" %>
 
rake db:migrate && rake db:fixtures:load
 
ruby script/server
 
# http://localhost:3000/posts/<post.id>/edit

Rails实例世界(No 2):很有前途的JavaScript框架Mootools

Gudao Luo2008-11-19 at 08:30发表的

很有前途的JavaScript框架Mootools On Rails
使用Mootools框架的基本方法
rails mootools_demo && cd mootools_demo
 
git clone git://github.com/pointcom/mootools-on-rails.git vendor/plugins/mootools-on-rails
 
rake mootools_on_rails:install
 
ruby script/generate scaffold post title:string body:text published:boolean
 
vi config/routes.rb
ActionController::Routing::Routes.draw do |map|
MootoolsOnRails.routes
 
vi app/views/layouts/posts.html.erb
<%= stylesheet_link_tag 'scaffold' %>
<%= javascript_include_tag :mootools %>
 
rake db:migrate
 
vi app/views/posts/index.html.erb
<% add_event('link', 'click') do |page|
page.alert('coucou div 2')
end %> <%= content_tag(:a, "Click My Link", :id => 'link') %>
 
ruby script/server

Rails实例世界(No 1):可视化路由工具vasco

Gudao Luo2008-11-16 at 06:49发表的

可视化路由工具vasco

  • 安装前提条件:
    • ruby version 1.8.6
    • gem version 1.3.1
    • rails version 2.1.2
    • git version 1.6.0.1
使用可视化理由工具vasco基本方法
rails demo_vasco && cd demo_vasco
 
ruby script/plugin install git://github.com/relevance/vasco.git
或者
cd vendor/plugins/ && git clone git://github.com/relevance/vasco.git && cd ../..
 
ruby script/generate scaffold post title:string body:text published:boolean
 
rake db:migrate
 
rake vasco:explore
 
ruby script/server
 
http://localhost:3000/vasco
  • 说明
    • 在Mac OS X上使用上面所说的方法一切正常
    • 在Debian Sarge 3.1 Server上使用上面所说的方法,在使用命令“rake vasco:explore”时,就会出现问题。
    • 在使用Mongrel服务器可以正常访问
    • 在使用Thin服务器可以访问vasco时,会出现下面错误:
      No route matches ”/vasco” with {:method=>:get}