Skip to content

Commit

Permalink
pre
Browse files Browse the repository at this point in the history
  • Loading branch information
the-teacher committed Apr 5, 2012
1 parent 9d4fa77 commit 970f157
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
3 changes: 2 additions & 1 deletion app/views/admin/roles/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
%p= link_to raw(t('.back')), admin_roles_path

%h2
= raw t('.name')
= @role.name
\-
= @role.title

= form_for :role, :url => {:action=> :update }, :html => {:method => :put, :class => :the_form } do |f|
Expand Down
15 changes: 1 addition & 14 deletions app/views/admin/roles/index.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- content_for :js do
- content_for :css do
= stylesheet_link_tag 'the_role/style'
= stylesheet_link_tag 'the_role/headers'
= stylesheet_link_tag 'the_role/form'
Expand All @@ -13,16 +13,3 @@
= link_to t('.delete'), admin_role_url(role), :method => :delete, :title => role.title, :confirm => t('the_role.delete_role'), :class => :delete

%p= link_to t('.new'), new_admin_role_path
-#
%p= link_to 'index r', admin_roles_path
%p= link_to 'new r', new_admin_role_path
%p= link_to 'edit r', edit_admin_role_path(Role.first)
%p= link_to 'show r', admin_role_path(Role.first)
%p= link_to 'update r', admin_role_path(Role.first), :method => :update
%p= link_to 'delete r', admin_role_path(Role.first), :method => :delete
%p= link_to 'create sec', admin_role_section_path(Role.first.name, :some_name)
%p= link_to 'create rule', create_rule_admin_role_section_path(Role.first.name, :some_name)
%p= link_to 'delete sec', admin_role_section_path(Role.first.name, :some_name), :method => :delete
%p= link_to 'delete rule', destroy_rule_admin_role_section_path(Role.first.name, :some_name, :name => :some_rule), :method => :delete
7 changes: 5 additions & 2 deletions lib/the_role/modules/role_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ def self.included(base)
base.class_eval do
has_many :users
validates :name, :presence => true, :uniqueness => true
validates :title, :presence => true
validates :title, :presence => true, :uniqueness => true
validates :description, :presence => true
before_create { self.the_role = {}.to_yaml }
before_create do
self.name = param_prepare(name)
self.the_role = {}.to_yaml
end

# C

Expand Down

0 comments on commit 970f157

Please sign in to comment.