module Ezframe::EditorCommon
Public Instance Methods
create_data(form)
click to toggle source
新規データの生成
# File lib/ezframe/editor_common.rb, line 12 def create_data(form) @column_set.clear @column_set[:id].value = id = @column_set.create(form) return id end
get_id(class_name = nil)
click to toggle source
# File lib/ezframe/editor_common.rb, line 3 def get_id(class_name = nil) class_name ||= @class_snake params = @request.env['url_params'] return nil unless params # EzLog.info "get_id: #{params.inspect}, #{class_name}" return params[class_name.to_sym] end
make_form(url, child)
click to toggle source
# File lib/ezframe/editor_common.rb, line 23 def make_form(url, child) return Ht.form(ezload: "command=set_validation:validate_url=#{url}", child: child) end
show_label_edit(key)
click to toggle source
ラベル付きで1カラムのformを表示
# File lib/ezframe/editor_common.rb, line 64 def show_label_edit(key) col = @column_set[key] Ht.span([Ht.small(col.label), col.form(force: true)]) end
show_label_view(key)
click to toggle source
ラベル付きで1カラムのviewを表示
# File lib/ezframe/editor_common.rb, line 58 def show_label_view(key) col = @column_set[key] Ht.span([Ht.small(col.label), col.view(force: true)]) end
show_message_page(title, body)
click to toggle source
エラーメッセージだけを表示するページを生成
# File lib/ezframe/editor_common.rb, line 70 def show_message_page(title, body) return show_base_template(title: title, body: Html.convert(body)) end
update_data(id, form)
click to toggle source
データの更新
# File lib/ezframe/editor_common.rb, line 19 def update_data(id, form) @column_set.update(id, form) end