Ruby on Rails: problem getting CKeditor to upload images -


After

when I can take a file and click "Send it to server"

I get an error :

  InvalidAuthenticityToken: {"Upload" => in the ActionController :: MediasController # new_from_disk parameter # & Lt; File: / var / folders / Fr / FrWbhcV1HdGpFgn7Lh7OhU +++ TI / -Tmp- / RackMultipart20100802 -4884-olu0e5-0-gt; "CKEditorFuncNum" = "42", "langcode" = & gt; "N", "CkAditor" = & gt; From my understanding of "object_content_body"}  

, the ckeditor uploader sends my ruby ​​action to the file, and I handle it then and there. So I do not need a scene associated with my new_from_disk operation (which does not currently do anything).

There is a document of uploading / browsing stuff that you have already uploaded. None of this has helped me

Is any one of the signs / guides? By default, the authenticity token of the user has been submitted to Rail - and raises one exception -

if it is not. This is to protect against CSRF (read more than at least)

Whenever you use a form_for , rail this authenticity mark as a hidden input The form will add to the deposit.

If you are not using form_for (or any of its derivatives), you obviously need to add this token to the parameters you submit is. You can reach the value of tokens using # {form_authenticity_token} . How do you submit it, it will depend on the CKDitter's API.

Alternatively, you can disable the on-line token check on every action basis ( not is recommended) such as:

 < Code> Class MediasController & lt; ApplicationController skip_before_filter: verify_authenticity_token :: only = & gt; [: New_from_disk] ... end  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -