similar to: escape_javascript error

Displaying 20 results from an estimated 1000 matches similar to: "escape_javascript error"

2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser via ajax. Something like: $("#inject").html("<%=escape_javascript(render :partial =>"feed/ index")%>"); Problem is escape_javascript ends up outputing all kinds of wasted space like \n\n\n\n\n \n Is there anyway in Rails to escape_javascript more
2011 Jun 08
1
Problem with escape_javascript in 3.0.9rc1
Specifically, this does not work! $("#lightbox_content").html(''<%= escape_javascript(render(:partial => "form")) %>''); Is this the correct way to do JQuery html replacement using a partial? This works fine in 3.0.7. Tony -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to
2006 May 19
1
how to access ActionView::Helpers::JavaScriptHelper::escape_javascript in a model (a newbie question)
Hi all, Please forgive me for this newbie question. But I really want to know how how to access ActionView::Helpers::JavaScriptHelper::escape_javascript method in a model. I can access this method in view, but when call it in the model, it ends up with undefined method. It seems to me they are in different scope. So what''s the best way to access view helper methods in model. --
2011 Sep 10
4
Finding HTML attributes with jQuery in Rails 3.1
I''m having trouble wrapping my head around the proper syntax to have jQuery (in an .js file) grab an HTML attribute and use the value of that attribute to load a partial. HTML fragment: <a href="/toggle" data-remote="true" section="training"> jQuery string (now setting a static partial, I need this to be dynamic)
2012 Feb 29
4
how to use link_to with :remote=>true in rails 3.2.1
I m using Rails 3.2.1. how to use link_to with remote=>true -------------------------------------------- My Method in Controller def clickme @clk = "you click me" respond_to do |format| format.js { render :layout=>false } end end -------------------------------------------- My View In my new.html.erb file <%= link_to "click here",
2011 Jun 15
5
rails 3.0.9
Today was expected the new stable rails release 3.0.9 with some fixed, among all the problem with escape_javascript. It seems that it see that has not been released, unfortunately. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2011 Nov 29
1
ajax question
Hello, could you please explain what''s wrong with this code: Rails 3.1.1 skills_controller.rb class SkillsController < ApplicationController # GET /skills # GET /skills.json def index @skills = Skill.all respond_to do |format| format.html # index.html.erb #format.json { render json: @skills } format.js end end end index.html.erb <%=
2011 Sep 27
1
Rails 3.1 assets path for video player Flash script 'player.swf'
I was using a Flash video player within a previous Rails version app Moving to Rails 3.1.0 , I dob''t know where I should put the script ... I tried to move it into an app asset sub-directory assets - jwplayer - - player.swf but this raises an error "NetworkError: 406 Not Acceptable - http://localhost:3000/assets/jwplayer/player.swf" player.swf the flash script is given as a
2010 Sep 27
9
Rails 3 - Creating a comment and then returning the Partial with JUST the new comment
Here''s the flow I have... First, jquery posts the new comment to the server: $.post(this.action,$(this).serialize(),null,''script''); Then in the comments controller: def create @comment = lots of stuff going on here but it works... if @comment.save flash[:notice] = "Successfully created comment."
2013 Oct 02
2
Rails 4 ujs button only works after second click
Here''s the code https://gist.github.com/dasibre/6786245 *new.js.erb file has the following js code* $(''a.pinbutton'').on(''click'', function() { $(this).parent().append(''<%= escape_javascript(render("select")) %>'') }); *here''s the player index with the new link* <%= link_to "Pin",
2012 May 21
4
Rendering partial views with ajax calls in rails 3.1
I''m starting now with rails, and i have simply question i think. I need to render two partials in one ajax call: I have the following controller: # GET /hosts/1 # GET /hosts/1.json def show @host = Host.find(params[:id]) respond_to do |format| format.html #show.html format.js format.json { render :json => @host } end
2010 Sep 22
3
how to remote function to get info from url in a javascript function
hey all I am working with a javascript function called Elabel, part of the Google maps api the Elabel has a function called setContents(html) i need to be able to call this function and get new html for it. ( the html is a table that displays weather data) here is what i have so far function replace_weather_table(){ zoomy = map.getZoom(); weather_table_one.setContents(new
2012 Aug 07
4
how to do render partial on jquery ajax success method with rails 3
I''m using rails 3.2.1 with jquery for an ajax call. My juqery code is : jQuery.ajax({ url: "/org_pages", data: ''org_id=''+ org_id, type: "POST", success: function(result){ jQuery("#image_center").html("<%= escape_javascript(render(:partial =>
2006 Apr 18
4
update_page yields escaped code in callback
Hi All, The subject pretty well describes what I am experiencing. This line in an .rhtml template: <%= link_to_remote menu_item.humanize, {:update => ''section'', :url =>{:controller => menu_item}, :complete => update_page do |page| page.activate_tab("#{menu_item}_tab", ''menu_'') page[''section''].hide
2012 Jan 05
8
js update partial missing template
PermissionsController def add_member ...snip... @permissions = Permission.all respond_to do |format| format.html { flash[:messages1] = @permission.user.name + " has been given rights." } format.js end end app/views/permissions/add_member.js.erb $(''#privileges'').replaceWith("<%=
2010 Sep 23
8
HowTo; Rails 3, having Tabs that load content via jQuery ... No Page Refesh
Hello, I''m interested in learning the correct/smart approach for implementing a web page with tabs and a content panel... When the tab is clicked by the user the tab''s content is fetched and inserted with jQuery... no page refresh... Example, Facebook, when you click Photos or Events, it doesn''t refresh the browser, just replaces the content with AJAX in the
2006 Nov 04
0
stumped trying to escape javascript
So I''ve got a few forms that update info using Ajax and form_remote_tag. I''ve got a javascript function that I call from within my render method in my controller, to take the contents of the flash and display them in a div that appears and then disappears. I''m using the following: render :update do |page| page << ''ShowMessage("''
2012 Feb 17
0
Passing a value to js.erb
Rails 3.1.3 I''m trying to pass a value to ''save.js.erb'' . in the view, I have put <%= hidden_field_tag "video-id", @video.id, { :id => "video-id" } %> then, I can retrieve it by var idval = $(''#video-id'').val(); It certainly gets the value. The problem is then I need to pass it to the following. I tried,
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All, I want to refresh a partial onClick, onClick i am making ajax call and getting the data but i am unable to refresh the partial. here is the code IN views: home.html.erb $(document).ready(function() { var currentCellText; $(".inline").click(function() { currentCellText = $(this).text(); $.ajax({ type: ''GET'', dataType: "json",
2007 Jan 23
7
Ajax
Hi, I need some help. I`m developing a data base administrator using ruby and ajax, both for the first time and I have a problem: I have a form where you can add or delete some information about a person., information related with their studies. There is no problem when I add, but when I delete, it deletes from the database but when I try to save it throughs me an error because it tries to find