Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
a6dc0001
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a6dc0001
编写于
4月 04, 2010
作者:
J
Jaime Iniesta
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace <pre> by <shell>, <ruby> and <yaml> on plugins guide; making it validate XHTML 1.0 Strict
上级
62fd691a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
railties/guides/source/plugins.textile
railties/guides/source/plugins.textile
+15
-14
未找到文件。
railties/guides/source/plugins.textile
浏览文件 @
a6dc0001
...
...
@@ -35,14 +35,14 @@ h4. Create the Basic Application
The examples in this guide require that you have a working rails application. To create a simple rails app execute:
<
pre
>
<
shell
>
gem install rails
rails yaffle_guide
cd yaffle_guide
rails generate scaffold bird name:string
rake db:migrate
rails server
</
pre
>
</
shell
>
Then navigate to http://localhost:3000/birds. Make sure you have a functioning rails app before continuing.
...
...
@@ -56,22 +56,22 @@ Rails ships with a plugin generator which creates a basic plugin skeleton. Pass
This creates a plugin in 'vendor/plugins' including an 'init.rb' and 'README' as well as standard 'lib', 'task', and 'test' directories.
Examples:
<
pre
>
<
shell
>
rails generate plugin yaffle
rails generate plugin yaffle --with-generator
</
pre
>
</
shell
>
To get more detailed help on the plugin generator, type +rails generate plugin+.
Later on this guide will describe how to work with generators, so go ahead and generate your plugin with the +--with-generator+ option now:
<
pre
>
<
shell
>
rails generate plugin yaffle --with-generator
</
pre
>
</
shell
>
You should see the following output:
<
pre
>
<
shell
>
create vendor/plugins/yaffle/lib
create vendor/plugins/yaffle/tasks
create vendor/plugins/yaffle/test
...
...
@@ -89,20 +89,20 @@ create vendor/plugins/yaffle/generators/yaffle
create vendor/plugins/yaffle/generators/yaffle/templates
create vendor/plugins/yaffle/generators/yaffle/yaffle_generator.rb
create vendor/plugins/yaffle/generators/yaffle/USAGE
</
pre
>
</
shell
>
h4. Organize Your Files
To make it easy to organize your files and to make the plugin more compatible with GemPlugins, start out by altering your file system to look like this:
<
pre
>
<
shell
>
|-- lib
| |-- yaffle
| `-- yaffle.rb
`-- rails
|
`-- init.rb
</
pre
>
</
shell
>
*vendor/plugins/yaffle/init.rb*
...
...
@@ -124,7 +124,7 @@ h4. Test Setup
*vendor/plugins/yaffle/test/database.yml:*
<
pre
>
<
yaml
>
sqlite:
:adapter: sqlite
:dbfile: vendor/plugins/yaffle/test/yaffle_plugin.sqlite.db
...
...
@@ -146,7 +146,7 @@ mysql:
:username: root
:password: password
:database: yaffle_plugin_test
</
pre
>
</
yaml
>
For this guide you'll need 2 tables/models, Hickwalls and Wickwalls, so add the following:
...
...
@@ -239,10 +239,10 @@ end
To run this, go to the plugin directory and run +rake+:
<
pre
>
<
shell
>
cd vendor/plugins/yaffle
rake
</
pre
>
</
shell
>
You should see output like:
...
...
@@ -1511,4 +1511,5 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213/tickets/32-update-plugins-guide
* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta
* November 17, 2008: Major revision by Jeff Dean
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录