similar to: ajax question

Displaying 20 results from an estimated 500 matches similar to: "ajax question"

2011 Apr 08
5
How to extend a helper using plugin?
Hello, I''m facing this problem while trying to extend the parse_redmine_links helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin. My idea is to use alias_method_chain so the extended version could call the original version and adjust the result to it''s liking. Anything I''ve tried so far exposes this behavior: the first render of a page uses the extended
2010 Mar 18
1
capitalize and utf8 international symbols
Hi there, Being a relatively happy Rails user I suddenly noticed that string#capitalize and friends do not play well with international characters well. Sample console session: $ ./script/console Loading development environment (Rails 2.2.3) >> $KCODE => "UTF8" >> "яблоко".capitalize => "яблоко" Where "Яблоко" was expected (Russian word
2011 Sep 14
1
Hitting 500 status code on invalid UTF-8 byte sequence in params
Hello Core, Background: with Redmine-1.2 on Rails-2.3.11 we''re experiencing a "500 Internal Server Error" every time a mail with invalid UTF-8 byte sequence is hitting the MailHandler (the exception comes from the DB complaining about invalid string in the INSERT statement.) Since we do care about internal errors we''ve installed exception_notification plugin and this
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();
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,
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 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)
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. --
2012 Jan 03
1
Rails 3.1 assets pipeline issue in production
I am running a jwplayer with an open ads server plugin .. it''s running fine in development, ads are served , but not in production on the remote server... I guess it''s related to the plugin file access ... in development , I wrote in the script : ''plugins'': { "/assets/jwplayer/ova-jw.swf": { "overlays": {"regions": [{
2009 Mar 30
0
Trying to bind an appended partial that has REST_in_place attached to it with jquery?
In my create.js.erb view I am creating a new model in the view. On creation I want to have the appended partial in the dom and selectable so I can click it''s name and run the plugin REST in place with Jquery. #create.js.erb $("#new_show").before(''<div id="flash_notice"><%= escape_javascript (flash.delete(:notice)) %></div>'');
2009 Aug 23
0
Best way of moving some jQuery from a view helper
I have a helper that uses some jQuery code that I would like to move out of the helper method. I am trying to move it to application.js but it will probably end up in a different file. I have two reasons for wanting to do this. 1) I want to keep all my jQuery code seperate to my HTML code 2) I want to change the append to an appendTo so I can add a highlight effect, appendTo which is proving
2009 Jun 03
3
Appending a Rails Partial with jQuery
Im not sure which group to post in, so i thought i''d try both. Any Rails peeps that use jQuery? Im having a problem. I have followed Ryan Bates Screencast about inserting a partial with jQuery and currently have it working in my app. What i really would like is to keep all my code in my application.js file vs a bunch of files all over my view folders. This is what i have in my
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 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
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
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",
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