Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.2, Formtastic 3 #190

Open
gwincr11 opened this issue Jun 26, 2015 · 1 comment
Open

Rails 4.2, Formtastic 3 #190

gwincr11 opened this issue Jun 26, 2015 · 1 comment

Comments

@gwincr11
Copy link

Hello,

I have been playing around with getting Rich to work with Formtastic 3 and Rails 4.2

I have discovered that it mostly works, the only thing that is preventing it from working is that the Rails actionview helper that creates the field, when using paperclip, tries to use the Paperclip object instance as the value for the field. When you pass in the field value with the input_html setting everything works.

It may be good to setup some defaults to handle this situation and pass in the value of the field automatically. Here is the settings that seem to work.

 <% p.input :photo, :as => :rich_picker,
        config: {
        :hidden_input => true,
        :placeholder_image => "",
        :scoped => "image"
      },
      input_html: {
        value: p.object.photo.url
      }
      %>

Any thoughts on this, I think that it would be relatively easy to collect this value and pass it to the builder, we may just need to have adapters for each supported image uploader to make up for differences between carrierwave and paperclip.

@gwincr11
Copy link
Author

As a side note, this is only an issue with creation forms, edit forms seem un-affected since an existing attribute is passed in as the value not an uploader instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant