fix images
This commit is contained in:
parent
7966437324
commit
e6effde4ff
@ -11,9 +11,9 @@ module Merged
|
||||
end
|
||||
|
||||
def set_image
|
||||
@card.content["image"] = params[:image]
|
||||
@card.image = params[:image]
|
||||
@card.save
|
||||
redirect_to section_cards_url(@card.section.id)
|
||||
redirect_to section_cards_url(@card.section.id) , notice: "Image selected: #{@card.image}"
|
||||
end
|
||||
|
||||
def move
|
||||
|
@ -37,9 +37,9 @@ module Merged
|
||||
end
|
||||
|
||||
def set_image
|
||||
@section.content["image"] = params[:image]
|
||||
@section.image = params[:image]
|
||||
@section.save
|
||||
redirect_to section_url(@section.id)
|
||||
redirect_to section_url(@section.id) , notice: "Image selected: #{@section.image}"
|
||||
end
|
||||
|
||||
def set_template
|
||||
|
@ -7,7 +7,8 @@ module Merged
|
||||
|
||||
include Optioned
|
||||
|
||||
fields :index , :section_id, :id , :text , :header, :image
|
||||
fields :id , :index , :section_id
|
||||
fields :text , :header, :image , :options
|
||||
|
||||
def move_up
|
||||
swap_index_with(next_card)
|
||||
|
@ -55,13 +55,14 @@ module Merged
|
||||
end
|
||||
|
||||
def save
|
||||
updated_at = Time.now
|
||||
super
|
||||
Page.save_all
|
||||
end
|
||||
|
||||
def self.new_page(name )
|
||||
raise "only alphanumeric, not #{name}" unless check_name(name).nil?
|
||||
data = { name: name.dup }
|
||||
data = { name: name.dup , updated_at: Time.now }
|
||||
Page.new(data)
|
||||
end
|
||||
|
||||
|
@ -7,8 +7,9 @@ module Merged
|
||||
|
||||
include Optioned
|
||||
|
||||
fields :name , :page_id , :index , :options
|
||||
fields :template , :card_template , :id , :text , :header, :image
|
||||
fields :id , :name , :page_id , :index
|
||||
fields :template , :card_template
|
||||
fields :header, :text , :image , :options
|
||||
|
||||
def cards
|
||||
Card.where(section_id: id).order(index: :asc)
|
||||
|
Loading…
Reference in New Issue
Block a user