Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding menu nav, adding permission enforcers to some controllers, add…
…ing details to User model
- Loading branch information
hornairs
committed
Apr 3, 2010
1 parent
927513a
commit f0ff732
Showing
24 changed files
with
537 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class AddDetailsToUser < ActiveRecord::Migration | ||
def self.up | ||
add_column :users, :active, :boolean | ||
add_column :users, :first_name, :string | ||
add_column :users, :last_name, :string | ||
add_column :users, :hourly_rate, :decimal | ||
add_column :users, :telephone, :string | ||
add_column :users, :employee_number, :string | ||
end | ||
|
||
def self.down | ||
remove_column :users, :employee_number | ||
remove_column :users, :telephone | ||
remove_column :users, :hourly_rate | ||
remove_column :users, :last_name | ||
remove_column :users, :first_name | ||
remove_column :users, :active | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2008 Daniel Haran | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
= SemanticMenu | ||
|
||
A plugin to make large menus easier to write. | ||
|
||
Supports arbitrarily deep nesting; parents will be marked as 'active' if any of its children are active. | ||
|
||
== Example | ||
|
||
<%= semantic_menu do |root| | ||
root.add "overview", root_path | ||
root.add "comments", comments_path | ||
end %> | ||
|
||
Assuming you are on /comments, the output would be: | ||
|
||
<ul class="menu"> | ||
<li> | ||
<a href="/">overview</a> | ||
</li> | ||
<li class="active"> | ||
<a href="/comments">comments</a> | ||
</li> | ||
</ul> | ||
|
||
add and semantic_menu both take an optional parameter hash, and you can nest the menu as deeply as you want: | ||
|
||
<%= semantic_menu :class => 'top_level_nav' do |root| | ||
root.add "overview", "root_path" | ||
root.add "comments", "comments_path", :class => 'button' do |comments| | ||
comments.add "My Comments", "my_comments_path" | ||
comments.add "Recent", "recent_comments_path" | ||
end | ||
end %> | ||
|
||
This would look like this: | ||
|
||
<ul class="top_level_nav"> | ||
<li> | ||
<a href="root_path">overview</a> | ||
</li> | ||
<li class="active"> | ||
<a href="comments_path" class="button">comments</a> | ||
<ul class="menu_level_1"> | ||
<li class="active"> | ||
<a href="my_comments_path">My Comments</a> | ||
</li> | ||
<li> | ||
<a href="recent_comments_path">Recent</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
|
||
Copyright (c) 2008 Daniel Haran, released under the MIT license |
Oops, something went wrong.