i have form(address) nested in form (customer). creating customer in app , when click creates, creates customer in database when routes show page, error.
first , foremost here error
nomethoderror in admin/customers#show showing /usr/local/rvm/gems/ruby-1.9.3-p392/bundler/gems/active_admin-fa7e4de2d5fa/app/views/active_admin/resource/show.html.arb line #1 raised: undefined method `address' #<customer:0x007ffb5619f420> extracted source (around line #1): 1: insert_tag renderer_for(:show) rails.root: /users/danielhatcher/rails/printonrails application trace | framework trace | full trace app/admin/customers.rb:29:in `block (2 levels) in <top (required)>' request parameters: {"id"=>"11"} here controller
activeadmin.register customer # menu item menu :label => "customers", :parent => "administration" filter :name, label: "by name" filter :company, label: "by company" filter :email, label: "by email" filter :phone, label: "by phone number" index column :name column :company column :email column :phone end form :partial => "form" show :title => :name panel "customer details" attributes_table_for resource row :name row :company row :email row :phone end end text_node(render :partial => "admin/addresses/form", :locals => { :address => resource.address }) end end here form
<%= form.has_many :addresses |address| address.inputs "address" address.inputs :class => "" address.input :street address.input :city address.input :state address.input :zip end end end %> customer model
class customer < activerecord::base attr_accessible :name, :email, :phone, :addresses_attributes, :company has_many :addresses accepts_nested_attributes_for :addresses, :allow_destroy => true end address model
class address < activerecord::base attr_accessible :street, :city, :state, :zip, :customer_id belongs_to :customer end i not sure why text node triggering error , appreciated.
Ruby - Nomethoderror Using Active Admin Rails 3 - >>>>> Download Now
ReplyDelete>>>>> Download Full
Ruby - Nomethoderror Using Active Admin Rails 3 - >>>>> Download LINK
>>>>> Download Now
Ruby - Nomethoderror Using Active Admin Rails 3 - >>>>> Download Full
>>>>> Download LINK id