ADD: picture to themengruppe

This commit is contained in:
HausdorffHimself
2013-08-23 13:40:42 +02:00
parent e87f108d8a
commit 7a18a53cc8
4 changed files with 10 additions and 1 deletions

View File

@@ -11,9 +11,10 @@
class Themengruppe < ActiveRecord::Base class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50 WORD_COUNT = 50
attr_accessible :text, :title attr_accessible :text, :title, :picture
has_many :themen, class_name: 'Thema' has_many :themen, class_name: 'Thema'
has_many :fragen, through: :themen has_many :fragen, through: :themen
mount_uploader :picture, PictureUploader
validates :title, :presence => true validates :title, :presence => true

View File

@@ -2,6 +2,7 @@
<%= semantic_form_for @thema do |f| %> <%= semantic_form_for @thema do |f| %>
<%= f.inputs do %> <%= f.inputs do %>
<%= f.input :title %> <%= f.input :title %>
<%= f.input :picture, :as => :file %>
<%= f.input :themengruppe %> <%= f.input :themengruppe %>
<%= f.input :text, :as=>:tinymce_text%> <%= f.input :text, :as=>:tinymce_text%>
<% end %> <% end %>

View File

@@ -1,7 +1,9 @@
<%= semantic_form_for @themengruppe do |f| %> <%= semantic_form_for @themengruppe do |f| %>
<%= f.inputs do %> <%= f.inputs do %>
<%= f.input :title %> <%= f.input :title %>
<%= f.input :picture, :as => :file %>
<%= f.input :text %> <%= f.input :text %>
<% end %> <% end %>
<%= f.actions do %> <%= f.actions do %>

View File

@@ -0,0 +1,5 @@
class AddPictureToThemengruppe < ActiveRecord::Migration
def change
add_column :themengruppen, :picture, :string
end
end