similar to: how to use link_to with :remote=>true in rails 3.2.1

Displaying 20 results from an estimated 2000 matches similar to: "how to use link_to with :remote=>true in rails 3.2.1"

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 Feb 10
0
Behaviour.js and prototype Event.observe
say I have some code like this: Behaviour.register({ ''#clickme'' : function(el) { Event.observe(el, ''click'', function(event) { alert("clickme was clicked"); }); } }); Behaviour.apply(); Behaviour.apply(); the element with the id of ''clickme'' will now have 3 onclick event observers. Is there a way to work around this? I
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)
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 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 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
2012 Mar 07
1
link_to with :remote=>true works when bound to "click" but not "ajax:beforeSend"
Hi. I am trying to do an ajax link in Rails 3.2.1 and jQuery. I am loading jquery.js and jquery_ujs.js. In my document ready, if I bind to the event "click," clicking the link fires an event, but if I click to ajax:beforeSend, it doesn''t. Nothing happens when you click the link in JQuery. The event does go to the controller, though. Works: $(document).ready(function(){
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."
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
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
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",
2009 Sep 04
2
escape_javascript error
Hello, I am using jQuery for all ajax stuff and recently got following error: ActionView::TemplateError (private method `gsub'' called for #<Array: 0x2425ae8>) on line #1 of... and the code where it happens: $("#notice_ajax").before(''<div id="notice_ajax"><%= escape_javascript (flash.delete(:notice)) %></div>'').remove();
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",
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. --
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
2009 Oct 19
1
Combobox population by means of JQuery and Ajax.
This is the view municipalities.js.erb I have: <% list_opt = options_from_collection_for_select(@municipalities, :id, :name) %> <% puts list_opt %> #ok! list_opt contains the options $(''#municipality_id'').html(''<%= list_opt %>''); and this is the combobox in the view: ... Comune <select id="event_municipality_id"
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("<%=
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 <%=
2006 Mar 10
0
link_to(... :popup => true) problem
I have a file_column that points to a pdf. I want that pdf to open in a new window, thus wrote the code: <%= link_to(''PDF version'', url_for_file_column(''floor_plan'', ''pdf_file''), :popup => true) %> which generates the code: <a href="/floor_plan/pdf_file/12/first_floor.pdf" onclick="window.open(this.href);return
2006 Feb 14
0
help: link_to with :post => true
I''m having trouble getting anything in the params hash when I do: <%= form_tag(:action => ''edit'') %> <table border="0" id="detailtable"> <tr> <td>* Email:</td><td><%= text_field_tag(''member[email]'') %></td> </tr> <tr> <td colspan="2" /> </tr>