mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 16:31:38 -04:00
Added bike models controller and views
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
= form_for bike_model, :html => { :class => 'form-horizontal' } do |f|
|
||||
.control-group
|
||||
= f.label :model, :class => 'control-label'
|
||||
.controls
|
||||
= f.text_field :model, :class => 'text_field'
|
||||
.control-group
|
||||
= f.label :bike_brand_id, :class => 'control-label'
|
||||
.controls
|
||||
= f.number_field :bike_brand_id, :class => 'number_field'
|
||||
.form-actions
|
||||
= f.submit nil, :class => 'btn btn-primary'
|
||||
= link_to t('.cancel', :default => t("helpers.links.cancel")), bike_models_path, :class => 'btn'
|
||||
@@ -0,0 +1,17 @@
|
||||
- model_class = BikeModel.new.class
|
||||
.page-header
|
||||
%h1=t '.title', :default => model_class.model_name.human.pluralize
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= model_class.human_attribute_name(:id)
|
||||
%th= model_class.human_attribute_name(:model)
|
||||
%th= model_class.human_attribute_name(:bike_brand_id)
|
||||
%tbody
|
||||
- bike_models.each do |bike_model|
|
||||
%tr
|
||||
%td= link_to bike_model.id, bike_model_path(bike_model)
|
||||
%td= bike_model.model
|
||||
%td= link_to bike_model.brand, bike_brand_path(bike_model.brand)
|
||||
= will_paginate bike_models
|
||||
= link_to t('.new', :default => t("helpers.links.new")), new_bike_model_path, :class => 'btn btn-primary'
|
||||
@@ -0,0 +1,4 @@
|
||||
- model_class = @bike_model.class
|
||||
.page-header
|
||||
%h1=t '.title', :default => t('helpers.titles.new', :model => model_class.model_name.human, :default => "New #{model_class.model_name.human}")
|
||||
= render :partial => "form"
|
||||
@@ -0,0 +1,15 @@
|
||||
- model_class = bike_model.class
|
||||
.page-header
|
||||
%h1=t '.title', :default => model_class.model_name.human
|
||||
|
||||
%p
|
||||
%strong= model_class.human_attribute_name(:model) + ':'
|
||||
%br
|
||||
= bike_model.model
|
||||
%p
|
||||
%strong= model_class.human_attribute_name(:bike_brand_id) + ':'
|
||||
%br
|
||||
= link_to bike_model.brand, bike_brand_path(bike_model.brand)
|
||||
|
||||
.form-actions
|
||||
= link_to t('.back', :default => t("helpers.links.back")), bike_models_path, :class => 'btn'
|
||||
Reference in New Issue
Block a user