Skip to content

Commit

Permalink
#20 detail page added
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdilek committed Sep 10, 2013
1 parent 1943cab commit ca81bb4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gem 'kangal', '~> 1.0.0'
gem 'rack-timeout', '~> 0.0.4'
gem 'recipient_interceptor', '~> 0.1.2'
gem 'ransack'
gem 'show_for', '~> 0.3.0.rc'

group :doc do
gem 'sdoc', require: false
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ GEM
rdoc (~> 3.10)
shoulda-matchers (2.3.0)
activesupport (>= 3.0.0)
show_for (0.3.0.rc)
actionpack (>= 3.2, < 5)
activemodel (>= 3.2, < 5)
simple_form (3.0.0.rc)
actionpack (>= 4.0.0.rc1, < 4.1)
activemodel (>= 4.0.0.rc1, < 4.1)
Expand Down Expand Up @@ -252,6 +255,7 @@ DEPENDENCIES
sass-rails (~> 4.0.0)
sdoc
shoulda-matchers (~> 2.3.0)
show_for (~> 0.3.0.rc)
simple_form (~> 3.0.0.rc)
sqlite3 (= 1.3.8)
turbolinks (~> 1.3.0)
Expand Down
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ en:
index: "%{resource_name} list"
edit: "Editing %{resource_name}"
new: "New %{resource_name}"
show: "%{resource_name} detail"
action_button:
new: "New %{resource_name}"
edit: "Edit"

7 changes: 6 additions & 1 deletion config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ tr:
tt:
index: "%{resource_name} listesi"
edit: "%{resource_name} düzenle"
new: "Yeni %{resource_name}"
new: "Yeni %{resource_name}"
show: "%{resource_name} detay"

action_button:
new: "Yeni %{resource_name}"
edit: "Düzenle"
2 changes: 1 addition & 1 deletion lib/templates/haml/scaffold/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- content_for :toolbar do
= link_to new_<%= singular_table_name %>_path, class: 'btn btn-default' do
%i.icon-plus
= t('tt.new', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
= t('action_button.new', resource_name: <%= singular_table_name.capitalize %>.model_name.human)

.panel.tables
.panel-heading
Expand Down
13 changes: 13 additions & 0 deletions lib/templates/haml/scaffold/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- content_for :toolbar do
= link_to edit_<%= singular_table_name %>_path(@<%= singular_name %> ), class: 'btn btn-default' do
%i.icon-pencil
= t('action_button.edit')
.panel
.panel-heading
%i.icon-edit.icon-large
= t('tt.show', resource_name: <%= singular_table_name.capitalize %>.model_name.human)
.panel-body
= show_for @<%= singular_name %> do |s|
<% attributes.each do |attribute| -%>
= s.<%= attribute.reference? ? :association : :attribute %> :<%= attribute.name %>
<% end -%>

0 comments on commit ca81bb4

Please sign in to comment.