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你这个头像比我的还黄啊.
这年头,奇怪的事情怎么这么多呢我就说
......
HTML code:
<%= link_to_if_authorized l(:field_search_title), {:controller => 'books', :action => 'search', :project_id => @project, :title => @title} %>
<%= text_field_tag 't ......
主要做哪个方面的?是编译型的么?
一门编程语言,不是编译型的
看看这里吧:
http://www.ruby-lang.org/en/
ruby是一门解释型的面向对象语言。最具代表的应用是rails---web快速开发框架
......
连接Mysql数据库的时候,老是报这个错误!不知道怎么回事
各位大大们,能否告知,感激不尽
另外,我在公司域中,可能会出现一些问题
NoMethodError in BookController#list
undefined met ......
ruby 关于加密,各位大大们知道怎么解决?
非常感谢!!
密码不以明文的保存形式,首先对其进行SHA1加密,然后保存一个160位的散列码,当用户登录是,对其输入的密码做同样的加密处理,并将加密的结果与数据库 ......