Note that there are some explanatory texts on larger screens.

plurals
  1. POWYSIHAT 'resonds_to_parent" undefined method - Ruby on Rails
    text
    copied!<p>I just successfully <a href="http://wiki.github.com/80beans/wysihat-engine/installation" rel="nofollow noreferrer">installed</a> <a href="http://www.80beans.com/2009/10/01/wysihat-engine/" rel="nofollow noreferrer">WysiHat</a> in my rails blog. Seems that the 'add a picture' feature is not working. It successfully allows me to find and select a picture from my desktop but upon clicking save, it does nothing. </p> <p>I also have Paperclip successfully installed and can attach images to records outside the WYSIHAT form field. </p> <p>Any ideas? (let me know if I need to post any code).</p> <p>Also, WysiHat-engine uses <a href="https://github.com/defunkt/facebox" rel="nofollow noreferrer">facebox</a>, not sure if that is relevant.</p> <p><strong>UPDATE</strong>: Added Server Log, looks like paperclip is saving it so not sure what else is going wrong.</p> <pre><code>Processing PostsController#update (for 127.0.0.1 at 2010-04-23 16:42:14) [PUT] Parameters: {"commit"=&gt;"Update", "post"=&gt;{"body"=&gt;"&lt;p&gt;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.&lt;/p&gt;", "title"=&gt;"Rails Code for Search"}, "authenticity_token"=&gt;"hndm6pxaPLfgnSMFAmLDGNo86mZG3XnlfJoNOI/P+O8=", "id"=&gt;"105"} Post Load (0.2ms) SELECT * FROM "posts" WHERE ("posts"."id" = 105) Post Update (0.3ms) UPDATE "posts" SET "updated_at" = '2010-04-23 21:42:14', "body" = '&lt;p&gt;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.&lt;/p&gt;' WHERE "id" = 105 [paperclip] Saving attachments. Redirected to http://localhost:3000/posts/105 Completed in 12ms (DB: 0) | 302 Found [http://localhost/posts/105] </code></pre> <p><strong>UPDATE 2</strong> I installed ImageMagic and now I get the following error. </p> <pre><code>Processing WysihatFilesController#index (for 127.0.0.1 at 2010-04-23 23:27:57) [GET] Parameters: {"editor"=&gt;"post_body_editor"} WysihatFile Load (0.3ms) SELECT * FROM "wysihat_files" Rendering wysihat_files/index Rendered wysihat_files/_form (1.9ms) Completed in 4ms (View: 3, DB: 0) | 200 OK [http://localhost/wysihat_files/?editor=post_body_editor] Processing WysihatFilesController#create (for 127.0.0.1 at 2010-04-23 23:28:09) [POST] Parameters: {"commit"=&gt;"Save changes", "wysihat_file"=&gt;{"file"=&gt;#&lt;File:/var/folders/F3/F3ovLEb1EMW4aZ5nsRvRlU+++TI/-Tmp-/RackMultipart20100423-43326-1mzeb3s-0&gt;}, "authenticity_token"=&gt;"IHF9Ghz6gYuAeNOUYhna+O0A4WrDbm4iha4Tsavu97o="} NoMethodError (undefined method `responds_to_parent' for #&lt;WysihatFilesController:0x10352a2c0&gt;): vendor/gems/wysihat-engine-0.1.12/app/controllers/wysihat_files_controller.rb:10:in `create' Rendered rescues/_trace (25.2ms) Rendered rescues/_request_and_response (0.3ms) Rendering rescues/layout (internal_server_error) </code></pre> <p><strong>Update 3</strong> After reading a comment below I am thinking that perhaps I am missing something in my Post model. Here is the code for the model.</p> <pre><code>class Post &lt; ActiveRecord::Base has_attached_file :photo validates_presence_of :body, :title has_many :comments, :dependent =&gt; :destroy has_many :tags, :dependent =&gt; :destroy has_many :ugtags, :dependent =&gt; :destroy has_many :votes, :dependent =&gt; :destroy belongs_to :user after_create :self_vote def self_vote # I am assuming you have a user_id field in `posts` and `votes` table. self.votes.create(:user =&gt; self.user) end cattr_reader :per_page @@per_page = 10 end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload