kreativgebiet / rich

:money_with_wings: An opinionated CKEditor editor for Rails with flexible image uploads
MIT License
418 stars 238 forks source link

undefined method `html_default_value' while working with rails_admin 0.6.5 #174

Open jacek213 opened 9 years ago

jacek213 commented 9 years ago

I configured rich just as shown on wiki page to work with rails_admin, however when I try to edit a resource which should use rich I get:

ActionView::Template::Error (undefined method `html_default_value' for #<RailsAdmin::Config::Fields::Types::RichEditor:0x00000005583b08>):
    1: = form.send 'text_area', field.method_name, field.html_attributes.reverse_merge((hdv = field.html_default_value).nil? ? {} : { :value => hdv })
    2: 
    3: = javascript_include_tag "rich/base.js"
    4: :javascript
rich (1.4.6) app/views/rails_admin/main/_form_rich_text.html.haml:1

Is rich compatible with rails_admin 0.6.5?

zackexplosion commented 9 years ago

I solve this with following step

replace

gem 'rich'

to

gem 'rich', github: 'bastiaanterhorst/rich'

and if you are using heroku do this too

https://github.com/bastiaanterhorst/rich/wiki/Troubleshooting

adrianmatteo commented 9 years ago

I had the same problem with rails_admin 0.7.0. Sourcing the directly from github solved it.

Can this be done without specifying the repo?

sebastian-palma commented 8 years ago

The same problem fixed using the answer of @zackexplosion, thanks.

Prastary commented 7 years ago

@zackexplosion how did you fix this problem? I still fight with it ;(