ruby操作文件
require 'app/configuration'
module RubyAMF
module Configuration
#set the service path used in all requests
# RubyAMF::App::RequestStore.service_path = File.expand_path(RAILS_ROOT) + '/app/controllers'
# => CLASS MAPPING CONFIGURATION
ClassMappings.register(
:actionscript => 'Stock',
:ruby => 'Stock',
:type => 'active_record',
:attributes => ["code", "name"])
end
end
ClassMappings.register(
:actionscript => 'Rolestock',
:ruby => 'Rolestock',
:type => 'active_record',
:associations => ["stock"],
:attributes => ["id", "cost", "amount"])
上面算是整个文件吧,之后我在另一个同等级路径文件下要操作这个文件
File.open("rubyamf_config.rb") do |file|
while line = file.gets
相关问答:
谁知道好用的Ruby IDE?
路过帮顶
帮顶
cheng_er你这个头像比我的还黄啊.
友情Up!~
纯顶
引用
cheng_er你这个头像比我的还黄啊.
这年头,奇怪的事情怎么这么多呢我就说
......
主要做哪个方面的?是编译型的么?
一门编程语言,不是编译型的
看看这里吧:
http://www.ruby-lang.org/en/
ruby是一门解释型的面向对象语言。最具代表的应用是rails---web快速开发框架
......
连接Mysql数据库的时候,老是报这个错误!不知道怎么回事
各位大大们,能否告知,感激不尽
另外,我在公司域中,可能会出现一些问题
NoMethodError in BookController#list
undefined met ......
新年刚开始,已经有一些生猛的朋友要开始新的职场生涯了,
不知道会不会遇到这样的问题: 想找一份Ruby on rails的工作,我应该知道哪些知识 ?
还好,我并不是想指点你什么,只是想按我的思维方式展 ......