1: 直接用SQL查询,而不用迁移
2:CREATE TABLE `company_info` 没有对应的model
3:class Department < ActiveRecord::Base
has_many :roles,:order=>'name' 为什么department有角色
4:权限model 有点意思:class Right < ActiveRecord::Base
has_and_belongs_to_many :roles
validates_presence_of :name,:message=>'没有填写频道名称'
end
5:socket: /opt/lampp/var/mysql/mysql.sock是什么意思?
E:\worksapce\hamster>ruby script/server
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
Your config/boot.rb is outdated: Run "rake rails:update".
rake rails:update
install -c -m 0755 E:/InstantRails20/ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/../../bin/dbconsole script/dbcons
ole (已经将boot.rb升级了)
E:/worksapce/hamster/app/controllers/application.rb has been renamed to E:/worksapce/hamster/app/controllers/application
_controller.rb, update your SCM as necessary
htpp://localhost:3000
出现no such file to load -- application.rb
copy application_controller.rb application.rb 就可以了
RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION 现在还不支持2.3.2版本
—menu.rhtml 好像不太合理,完全更具权限的顺序排列,只是根据权限组分类了,菜单组=权限组
@session[:rights] = buildMenu '权限管理' 是关键
少一个模块管理,如果有就OK了,功能可以自己定义了
可能是这样的层次,最上层是模块==频道组==频道, 频道组于模块是什么关系?
很多模块的_menu.rhtml 是类似的,如何将它重组,实现DRY
权限管理这个模块的名字应该叫组织管理比较好,因为它有部门、角色、用户、权限等管理组成
没有LOGOUT功能
<%if !'self'.eql? @type%>
<div id="sidebar">
<%currentGroup = ''%>
<%i=0%>
<%@session[:rights].each do |right|%>
<%if !currentGroup.eql? right.mgroup%>
<%if !currentGroup.eql? ''%>
</ul>
</div>
</div>
<%end%>
<%currentGroup = right.mgroup%>
<div <%='id="related"' if i==0%><%='class="pagetools"' if i!=0%>">
<%i=i+1%>
<div>
<h3><%=right.mgroup%></h3>
<p>
<ul>
<%end%>
<li><a href="/<%=right.url%>"><%=right.name%></a></li>
<%end%>
</ul>
</div>
</div>
</div>
<%end%>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛