Mamadou TourÃ© wrote:
Hi Marnen, here is my controller code (the method ‘generer’ is triggered
once a user hit a submit button)
I don’t see offhand why your render statement isn’t working well, but
you’ve got a lot of other problems in your code.
First of all, the entire method may be too long. You may want to split
vue = getvue(params[:id])
Why not an ActiveRecord query? And why getvue instead of get_vue ?
arr_doc = Array.new()
That line is unnecessary, since the split in the next line already
creates the array.
arr_doc = params[:arr].split(",")
The brackets in the regex are unnecessary. Actually, the regex itself
can just be a string. Anyway, the whole line is probably unnecessary,
since it doesn’t look like params[:arr] gets referred to after this.
vaat_val_lang = vue.langue
Why eql? ? It’s perfectly fine to use == with strings.
vaat_id_lang = 5
vaat_id_lang = 6
You could probably replace this with an AR query.
plsql = nil
plsql = connection.parse('begin
plsql.bind_param(':p_dect_id', vue.dect_id, Integer)
plsql.bind_param(':p_vaat_id_langue_docu', vaat_id_lang, Integer)
plsql.bind_param(':p_list_doc', params[:arr], String)
Why not just find_by_sql or connection.execute ?
render :js => "alert('Test !');"
This should work. In fact, it sounds like it is working – it’s
sending the text to the browser just like it should. What it may not be
doing properly is setting the MIME type. Can you check the MIME type of