Topic: how to use gem tiny_mce
Hi everyones. I have a problem with this gem, I read the document and don 't know how to use it ?
I am a new mem, so you can help me to run this thing!
thanks ![]()
You are not logged in. Please login or register.
Rails Forum - Ruby on Rails Help and Discussion Forum » Plugin/Gem Usage and Development » how to use gem tiny_mce
Hi everyones. I have a problem with this gem, I read the document and don 't know how to use it ?
I am a new mem, so you can help me to run this thing!
thanks ![]()
What version of Rails are you using? For 3.1 or above, this is recommended:
https://github.com/spohlenz/tinymce-rails
thanks ,BradHodges
I am using rails 3.1 , and i install this https://github.com/kete/tiny_mce
I read document and don 't know how to build 1 search (using tiny_mce) work with ajax .
Do you know how to do that? plz instruct me detail ![]()
Thanks very much
Read the docs at the link you posted, it does not recommend that gem for 3.1
Sorry
, my mistake
BradHodges , I have a problem about link url when render.
When sign in , it go to "user/new/html" , this view call ajax and render to _basicInformation , then click next goto _profilePicture (to upload photo).
From view upload photo (http://localhost:3000/users/1/edit) , when submit form , it will call controller upload - function create
When the image save ok, I want jump back to view 'user/new.html' (because I want it render ajax _profilepicture again to show picture have uploaded) , I try to use : render 'user/new.html'
It render to _profilePicture , every thing ok but the link is : http://localhost:3000/uploads
How could i change the link back to http://localhost:3000/users/1/edit
Note* : I have no view edit
Thanks much
redirect_to :action=>:edit , :id=>@user.id
or
render :action=>:edit, :id=>@user.id
It depends on what you want, the first will fire the :edit action in your controller, then render the edit view. When you successfully save the user you should do the first, and you'll see the user and the just uploaded photo because the edit action in the controller loads it.
The second will just re-render the edit view, using the @user values as they exist already. If there is some kind of error, the save failed for example, you should do the second, so the form can be corrected and re-submitted.
>Note* : I have no view edit
Sorry, missed that
OK, so do you have an edit or show action in your controller?
If not, you'll have to write one, because you'll need to reload the @user to see the photo. You don't HAVE to create an edit view, you can just override Rails default (render show.html.erb or edit.html.erb), and tell it to render new.html.erb:
def show
@user = User.find(params[:id)
render :action=>:new
end
def edit
@user = User.find(params[:id)
render :action=>:new
end
Last edited by BradHodges (2011-10-25 17:10:02)
so wonderful ![]()
OH no, it still stuck.
From view upload photo (http://localhost:3000/users/1/edit) , when submit form , it will call controller upload - function create
When the image save ok, I want jump back to view 'user/new.html' (because I want it render ajax _profilepicture again to show picture have uploaded) , I try to use : render 'user/new.html'
It render to _profilePicture , every thing ok but the link is : http://localhost:3000/uploads
How could i change the link back to http://localhost:3000/users/1/edit
Note* : I have no view edit
If in controller update (function create) I redirect to @user , it not call show , but call index , how can I go to view 'users/new.html' with link http://localhost:3000/users/1/edit
Hosting provided by aTech Media