Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion cannot set up my first custom input correctly... No input found for

Received: by 10.58.70.146 with SMTP id m18mr2334865veu.0.1348838901031;
        Fri, 28 Sep 2012 06:28:21 -0700 (PDT)
X-BeenThere: plataformatec-simpleform@googlegroups.com
Received: by 10.220.38.68 with SMTP id a4ls243906vce.6.gmail; Fri, 28 Sep 2012
 06:28:20 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.35.84 with SMTP id f20mr1638170vdj.3.1348838900522; Fri, 28
 Sep 2012 06:28:20 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
 kadou...@gmail.com designates internal as permitted sender)
 smtp.mail=kadou...@gmail.com; dkim=pass
 header...@gmail.com
Received: by d7g2000vbf.googlegroups.com with HTTP; Fri, 28 Sep 2012 06:28:20
 -0700 (PDT)
Date: Fri, 28 Sep 2012 06:28:20 -0700 (PDT)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)
 AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1,gzip(gfe)
Message-ID: <5d54e9e6-ccba-4359-a81a-f99be8134cb7@d7g2000vbf.googlegroups.com>
Subject: cannot set up my first custom input correctly...   No input found for
From: erwin <kadou...@gmail.com>
To: SimpleForm <plataformatec-simpleform@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

I am trying to write my first custom input, first to test the setup,
but it seems that I did not get it right the first time

In my view , I wrote the simple_form input like this :

= f.input :starts_at, :as => :mystuff, :input_html => {:value =>
"12/02/2013" }, :class => "span2"


I have put in  app/inputs/mystuff.rb

class MystuffInput < SimpleForm::Inputs::StringInput
  def input
    debugger
    super
  end
end

In my config/application.rb , I have autoload paths :
config.autoload_paths += Dir["#{config.root}/lib", "#{config.root}/lib/
**/", "#{config.root}/app/inputs"]

And finally in my config/initializers/simple_form.rb  , I have :

config.input_mappings = { /mystuff/ => :mystuff }
 config.inputs_discovery = true

I thought my setup was complete, but  on  form view display, I get :
RuntimeError in Backoffice/events#new

No input found for mystuff

The trace show that the error happen in the mapping ...
simple_form (2.0.2) lib/simple_form/form_builder.rb:441:in
`find_mapping'
simple_form (2.0.2) lib/simple_form/form_builder.rb:372:in
`find_input'
simple_form (2.0.2) lib/simple_form/form_builder.rb:115:in `input'
app/views/backoffice/events/new.html.haml:12:in `block in
_app_views_backoffice_events_new_html_haml__3541661266551348407_70152580768420'

what is wrong in my initialization ?

thanks for feedback