take new back out of images into ruby land

This commit is contained in:
2023-01-09 20:48:14 +02:00
parent 484fa4f6e7
commit 68179949c8
8 changed files with 59 additions and 60 deletions

View File

@ -17,16 +17,25 @@ module Merged
def text_for_new
if(section_id)
section = Section.find(section_id)
"Add image for Section"
"Add image for Section: #{section.header}"
elsif(card_id)
card = Card.find(card_id)
"Select image for Card"
"Select image for Card: #{card.header}"
else
"New Image"
end
end
def hidden_for_select
def new_link_params
if(params[:section_id])
return {section_id: params[:section_id]}
end
if(params[:card_id])
return {card_id: params[:card_id]}
end
nil
end
def hidden_for_select_image
if(section_id)
hidden_field_tag :section_id , section_id
elsif(card_id)