You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
I have a lot of js files like new.js, index.js, create.js etc that handles my Ajax calls and other jquery code As the have many common code snippets I have tried to use partial js files For example I have a new.js file that calls a partial _new.js
That works but to be useful I would like to add locals as <%= render :partial=>'new', :formats=>[:js],:handlers=>[:erb], locals=>{id=>"#group_participants_content"}%> and change _new.js to $('"'+id+'"').html("<%= escape_javascript(render(:partial=>'form'))%>"); However that does not work- The js file seems then not to be loaded at all
Anyone that has any suggestion of what is wrong ?
Appreciate any help ?
Colin Law
unread,
Jul 28, 2013, 5:50:55 AM7/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
>
> That works but to be useful I would like to add locals as
> <%= render :partial=>'new', :formats=>[:js],:handlers=>[:erb],
> locals=>{id=>"#group_participants_content"}%>
I don't know whether there are any other problems but it should be
:locals and :id I think
Colin
> and change _new.js to
> $('"'+id+'"').html("<%= escape_javascript(render(:partial=>'form'))%>");
> However that does not work- The js file seems then not to be loaded at all
>
> Anyone that has any suggestion of what is wrong ?
>
> Appreciate any help ?
>
>
>
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com, cla...@googlemail.com
Colin Thanks for your answere, but that was just a typo from me. The code has :locals and :id
Colin Law
unread,
Jul 28, 2013, 6:56:19 AM7/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
On 28 July 2013 11:28, Hans <Hans.M...@klockholm.se> wrote:
> Colin
> Thanks for your answere, but that was just a typo from me. The code has
> :locals and :id
When asking questions it is always a good idea to copy/paste then you
are more likely to get helpful replies. Perhaps there are different
typos in your code that you have accidentally corrected when you
re-typed it here.
Colin
Hans
unread,
Jul 28, 2013, 8:16:51 AM7/28/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com, cla...@googlemail.com
The problem is now solved The correct use of locals should be
$("<%=id%>").html("<%= escape_javascript(render(:partial=>'form'))%>"); and not