lib/generators/dry_crud/templates/app/helpers/standard_helper.rb
# Returns the name of the attr and it's corresponding field
Returns the name of the attr and it's corresponding field
Returns the name of the attr and it ' s corresponding field
def assoc_and_id_attr(attr)
    attr = attr.to_s
    attr, attr_id = if attr.end_with?('_id')
      [attr[0..-4], attr]
    elsif attr.end_with?('_ids')
      [attr[0..-5].pluralize, attr]
    else
      [attr, "#{attr}_id"]
    end
  end
def assoc_and_id_attr ( attr ) attr = attr . to_s attr , attr_id = if attr . end_with? ( '_id' ) [ attr [ 0 .. - 4 ] , attr ] elsif attr . end_with? ( '_ids' ) [ attr [ 0 .. - 5 ] . pluralize , attr ] else [ attr , "#{attr}_id" ] end end
Returns the name of the attr and it's corresponding field
Returns the name of the attr and it ' s corresponding field
attr