created items and configured back office ui a bit

This commit is contained in:
Senad Uka
2015-01-18 10:24:15 +01:00
parent 6d1ac88a7f
commit d09bc71aae
32 changed files with 368 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
class ItemsController < ApplicationController
active_scaffold :"item" do |conf|
conf.columns[:unit].form_ui = :select
end
end

View File

@@ -0,0 +1,4 @@
class MediaTypesController < ApplicationController
active_scaffold :"media_type" do |conf|
end
end

View File

@@ -0,0 +1,5 @@
class MultiMediaDescriptionsController < ApplicationController
active_scaffold :"multi_media_description" do |conf|
conf.columns[:media_type].form_ui = :select
end
end

View File

@@ -0,0 +1,4 @@
class UnitsController < ApplicationController
active_scaffold :"unit" do |conf|
end
end

View File

@@ -0,0 +1,4 @@
module ItemsHelper
end

View File

@@ -0,0 +1,2 @@
module MediaTypesHelper
end

View File

@@ -0,0 +1,2 @@
module MultiMediaDescriptionsHelper
end

View File

@@ -0,0 +1,2 @@
module UnitsHelper
end

View File

@@ -1,4 +0,0 @@
class Category < ActiveRecord::Base
has_many :sub_categories
belongs_to :section
end

4
app/models/category.rb Normal file
View File

@@ -0,0 +1,4 @@
class Category < ActiveRecord::Base
has_many :sub_categories
belongs_to :section
end

4
app/models/item.rb Normal file
View File

@@ -0,0 +1,4 @@
class Item < ActiveRecord::Base
belongs_to :unit
has_many :multi_media_descriptions
end

3
app/models/media_type.rb Normal file
View File

@@ -0,0 +1,3 @@
class MediaType < ActiveRecord::Base
has_many :multi_media_descriptions
end

View File

@@ -0,0 +1,5 @@
class MultiMediaDescription < ActiveRecord::Base
belongs_to :item
belongs_to :media_type
end

View File

@@ -1,3 +1,3 @@
class Section < ActiveRecord::Base
has_many :categories
has_many :categories
end

2
app/models/unit.rb Normal file
View File

@@ -0,0 +1,2 @@
class Unit < ActiveRecord::Base
end

View File

@@ -1,12 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Ribicabackoffice</title>
<title>Ribica Back Office</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<div>
<%= link_to "Items", items_path %>
<%= link_to "Sections", sections_path %>
<%= link_to "Units", units_path %>
<%= link_to "Media Types", media_types_path %>
</div>
<%= yield %>