Great job, Imre, thanks for that!
-- Jarda

On 15.8.2012 12:24, Imre Farkas wrote:
I played with simple_form to get an idea of how difficult the markup is to implement.

Step 1: Created a new wrapper. You can find the code here: https://gist.github.com/bf366db929ee55af7e82 Step 2: Created a new simple_form component for other fields e.g. 'note': https://gist.github.com/3358420 Step 3: Change the default wrapper for simple_form in the initializer: config.default_wrapper = :conductor

After these steps, implementing a form is pretty easy:
= simple_form_for(@post) do |f|
  = f.input :title, :placeholder => 'placeholder',
                    :hint => 'hint',
                    :note => 'note'

The added benefit of simple_form is that you will automatically get the require/optional class for the inputs for free based on the validations of the model (You can override them via options if necessary). The same applies for the maxlength attribute of the input field. Developers won't need to implement the markup Jarda created, but using a simple api call would do the magic.

Imre

Reply via email to