80beans / wysihat-engine

A Rails engine to help integrate the 37signals WysiHat rich text editor to your application.
http://www.80beans.com/2009/10/01/wysihat-engine/
MIT License
167 stars 16 forks source link

Image button not working #17

Open MissingHandle opened 14 years ago

MissingHandle commented 14 years ago

Attempting to add an image through the toolbar results in "unitialized constant WysihatFilesController"

on Rails 3.0.0 wysihat-engine-0.1.13

slash4 commented 13 years ago

Up ! Got the same here... Searching for several hours now, and still nothing. Seems to be very tied to Rails version (3.0.3 here).

Does anybody have a workaround for this ?

slash4 commented 13 years ago

Finally I implemented TinyMCE from https://github.com/sandipransing/rails_tiny_mce, and... I got the same one ! I found in the end it was simply a routing problem. First, test uncommenting the last line in routes.rb (match ':controller(/:action(/:id(.:format)))'). If it works, then double check the routes you set up for editor, they must be screwed up !

alantocheri commented 13 years ago

Had the same issue running rails 3.0.1. I had a 'duh' moment looking at this.

The error is basically saying it doesn't have a controller for WysihatFiles. Which doesn't seem to get generated in this gem (correct me if I'm wrong)

So I just ran this:

rails g scaffold WysihatFile file_file_name:string file_content_type:string file_file_size:string file_updated_at:datetime

It'll yell at you saying you have the same name for the migration, but that's fine. Of course, if you have the controller setup already - then ignore everything I said.

Issue - you have to build the 'show' view to display the files the way you'd like. I'm not sure how to make that link back to the editor.

alantocheri commented 13 years ago

Of course you shouldn't have to do any of what I said, since the gem has everything in it. I have no idea why it isn't showing up. Maybe a Rails 3.0 thing?

kirillrdy commented 13 years ago

I found a walkaround When declaring wysihat-engine in Gemfile it will only load file in (gem)/lib/whysihat-engine.rb, which doesnt include the controller or models. So I just extracted the gem into vendor/plugins ( and kept it in Gemfile )

sad sad Friday.......