Ich habe das nächste Problem:NoMethodError in Item_categories # new
/Users/felipevelasquez/Desktop/APPS/meetrico2/meetrico-production/app/views/item_categories/_form.html.haml zeigt, wo # line 40 angehoben :
undefinierten Verfahren `cupon_code für #
‘Extrahierte Quelle (um Zeile # 40):
37: %p
38: = f.label :cupon_code, "Codigo de cupon"
39: %br/
40: = f.text_field :cupon_code
41: %p.columns
42: = f.label :num_tables, "No. Prod:"
43: %br/
Trace of template Inklusion: app/views/item_categori es/new.html.haml
Rails.root:/Benutzer/felipevelasquez/Desktop/APPS/meetrico2/meetrico-Produktion Anwendung Trace | Rahmenverfolgung | Voll Trace
app/views/item_categories/_form.html.haml: 40: in block in _app_views_item_categories__form_html_haml__1368949097161944936_70115358072760' app/views/item_categories/_form.html.haml:1:in
_app_views_item_categories__form_html_haml__1368949097161944936_70115358072760' app/views/item_categories/new.html.haml: 4: in _app_views_item_categories_new_html_haml__3526667596950049714_70115303712400' config/initializers/quiet_assets.rb:13:in
call_with_quiet_assets'
Anfrage
Parameter:
Keine
anzeigen Sitzung Dump
anzeigen env-Dump Antwort
Headers:
Keine
ich das Feld in meinem db cupon_code erstellt, hier ist mein Schema:
create_table "transactions", :force => true do |t|
t.integer "order_id"
t.string "action"
t.integer "amount"
t.boolean "success"
t.string "authorization"
t.string "message"
t.text "params"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "cupon_code"
Kann jemand sehen, wo das ist Problem?
Dies ist das Loch Form:
= form_for @item_category, html: { class: 'upload-file-or-text'} do |f|
%p
= f.label :coworking_space, "Coworking Space"
%br/
= select_tag "item_category[coworking_space_id]", options_from_collection_for_select(@coworking_spaces, "id", "name", @item_category.coworking_space_id)
%p
= f.label :name, "Nombre"
%br/
= f.text_field :name, :required=>"required",:title=>"Este campo es obligatorio"
%p.columns
= f.label :image_text_url, "Url de Imagen o Icono"
%br/
= f.text_area :image_text_url, :size => "40x4", class: 'image-text'
%p.columns
= f.label :image_file, "O sube una imagen"
- if @item_category.image_file?
%br/
= image_tag @item_category.image_url, class: 'image-thumb'
%label
= f.check_box :remove_image_file, class: 'remove-ckeck'
Eliminar image?
%br/
= f.file_field :image_file, class: 'image-file'
%p.alert-message.hide
Debe elegir alguna de estas opciones
%p
= f.label :description, "Descripción"
%br/
= f.text_area :description, :size => "40x4"
%p
= f.label :notification_body, "Cuerpo de Notificacion"
%br/
= f.text_area :notification_body, :size => "40x4"
%p
= f.check_box :promo_header
Línea de Producto de la cabecera
%p
= f.label :cupon_code, "Codigo de cupon"
%br/
= f.text_field :cupon_code
%p.columns
= f.label :num_tables, "No. Prod:"
%br/
= f.text_field :num_tables
%p.columns
= f.label :reserved, "Reservas:"
%br/
= f.text_field :reserved
%p
= f.label :normal_price, t(:normal_sale_price)
%label
= "en #{@item_category.coworking_space.city.currency.name rescue " "}"
%br/
= f.text_field :normal_price
%p.columns
= f.label :green, "Green:"
%label
= "en #{@item_category.coworking_space.city.currency.name rescue " "}"
%br/
= f.text_field :green
%p.columns
= f.label :green, "Yellow:"
%label
= "en #{@item_category.coworking_space.city.currency.name rescue " "}"
%br/
= f.text_field :yellow
%p.columns
= f.label :green, "Red:"
%label
= "en #{@item_category.coworking_space.city.currency.name rescue " "}"
%br/
= f.text_field :red
%p
= f.label :target_url, t(:target_url)
%br/
= f.text_field :target_url
%p= f.submit
Können Sie das ganze Formular posten? – Ruslan
haben Sie eine Migration erstellt und ausgeführt, um den Cupon-Code hinzuzufügen? – Felix
Ja, ich tat, in den Tabellentransaktionen. Dies ist, was ich getan habe: Schienen generieren Migration AddCuponCodeColumnToTransactions cupon_code: Ganzzahl – user2284348