sticky topics
This commit is contained in:
@@ -8,6 +8,7 @@ class HomeController < ApplicationController
|
||||
else
|
||||
@starttopic=@themen = nil
|
||||
end
|
||||
@stickythemen = Thema.where(:sticky_startpage=>true)
|
||||
end
|
||||
def dev
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
require 'uri'
|
||||
class Thema < ActiveRecord::Base
|
||||
include Rails.application.routes.url_helpers
|
||||
attr_accessible :text, :title, :themengruppe_id,:isdraft, :hidelink, :hideattachment
|
||||
attr_accessible :text, :title, :themengruppe_id,:isdraft, :hidelink, :hideattachment, :sticky_startpage,:sticky_intern
|
||||
has_many :fragen
|
||||
has_many :attachments
|
||||
belongs_to :themengruppe, :foreign_key => "themengruppe_id"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :hideattachment %>
|
||||
<%= f.input :sticky_intern %>
|
||||
<%= f.input :sticky_startpage %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
9
db/migrate/20150219142123_add_sticky_to_thema.rb
Normal file
9
db/migrate/20150219142123_add_sticky_to_thema.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AddStickyToThema < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :themen, :sticky_startpage, :boolean
|
||||
add_column :themen, :sticky_intern, :boolean
|
||||
add_column :themengruppen, :sticky_startpage, :boolean
|
||||
add_column :themengruppen, :sticky_intern, :boolean
|
||||
add_column :galleries, :sticky_startpage, :boolean
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user