只显示主题贴
@tccom042s=Tccom042.find_by_sql("select id ,sg from tccom042s")
for @i in 0..2
@first =@tccom042s[@i]
@sg=@first.id.to_s
puts "-----------heelooeooweriwer----------"+@sg
打印的结果是15,16,17,本意是当@sg为15的出现a的连接,16,17的时候就出现b的连接,但列表中只出现了a的连接,指针就指向了第一条记录,没有next.请帮忙,谢谢!
if(@sg==15)
conf.nested.add_link( ...
- 进入论坛 Ruby 版
@tccom042s=Tccom042.find_by_sql("select id ,sg from tccom042s")
for @i in 0..2
@first =@tccom042s[@i]
@sg=@first.id.to_s
puts "-----------heelooeooweriwer----------"+@sg
打印的结果是15,16,17,本意是当@sg为15的出现a的连接,16,17的时候就出现b的连接,但列表中只出现了a的连接,指针就指向了第一条记录,没有next.请帮忙,谢谢!
if(@sg==15)
conf.nested.add_link( ...
- 进入论坛 入门讨论 版
@tccom042s=Tccom042.find_by_sql("select id ,sg from tccom042s")
for @i in 0..2
@first =@tccom042s[@i]
@sg=@first.id.to_s
puts "-----------heelooeooweriwer----------"+@sg
打印的结果是15,16,17,本意是当@sg为15的出现a的连接,16,17的时候就出现b的连接,但列表中只出现了a的连接,指针就指向了第一条记录,没有next.请帮忙,谢谢!
if(@sg==15)
conf.nested.add_link("a", ...
- 进入论坛 入门讨论 版
学习ruby on rails 都失去信心了,问了问题也找不到别人解决,这个论坛很不活跃啊,有没有活跃点网址介绍?
- 进入论坛 入门讨论 版
已经按cvu 的方法在model中设置了change_xyz_status已经可以实现了,但请问在controller里如何实现如果下面操作,谢谢!
if list.columns[:name].nil?
conf.nested.add_link("aa", [:aa])
else
conf.nested.add_link "bb", [:bb]
end
- 进入论坛 入门讨论 版
有没有相关资料介绍?
change_xyz_status应该怎么写?我找了好久都没有资料,一个感觉就是太少人接触activescaffold了,太少资料了,手足无措!
- 进入论坛 入门讨论 版
第一个问题经过修改已经通过
def authorized_for_update?
self.name.nil? ? true:false
end
想问问如果在actioner里面如何判断?谢谢!下面代码哪里错?
--------------------------------------------------------------------------------
if list.columns[:name].nil?
conf.nested.add_link("aa", [:aa])
else
conf.nested.add_link "bb", [:bb]
end
第三个 ...
- 进入论坛 入门讨论 版
1. 这是AS里security机制管的。在model里:
Ruby代码
def authorized_for_update?
false if self.name.nil?
true
end
2. 如果只是隐藏这个nested scaffold的操作,可以用css。比如:
#active-scaffold-parents-tbody #active-scaffold-children a.action { display:none; }
3. AS的做法是用它在controller里的回调方法before_update_save或者after_up ...
- 进入论坛 入门讨论 版
更新一个表的数据的同时update另外一个表的状态,出错了!应该怎么写?谢谢!
class abc
before_update :change_xxx_status
def change_xxx_states
@zc = Zc.find(params[:createby])
respond_to do |format|
if @zc.update_attributes(:status=> '2')
flash[:notice] = 'successfully updated.'
format.html { redirect_to(@abc) }
format.xml { head :ok ...
- 进入论坛 Ruby 版
1:假如字段name项中数据为空的时候,编辑按钮为可用,否则屏蔽
2:更新一个表的数据的同时update另外一个表的状态
麻烦高手们给予指导,谢谢!
- 进入论坛 入门讨论 版







评论排行榜