helpers/common_helpers.rb
# Add a row to a grid. created_at and updated_at values are provided automatically.
#
# @param attrs [Hash] the columns and their values.
# @param notice [String/Nil] the flash message to show.
# @return [JSON] the changes to be applied.
Add a row to a grid. created_at and updated_at values are provided automatically.
Add a row to a grid . created_at and updated_at values are provided automatically .
def add_grid_row(attrs:, notice: nil)
    res = action_add_grid_row(attrs: attrs)
    res[:flash] = { notice: notice } if notice
    res.to_json
  end
def add_grid_row ( attrs : , notice : nil ) res = action_add_grid_row ( attrs : attrs ) res [ :flash ] = { notice : notice } if notice res . to_json end
Add a row to a grid.
Add a row to a grid .
# res = { addRowToGrid: { changes: attrs.merge(created_at: Time.now.to_s, updated_at: Time.now.to_s) } }
the changes to be applied.
the changes to be applied .
JSON
attrs
the columns and their values.
the columns and their values .
notice
the flash message to show.
the flash message to show .