0
votes
1answer
22 views

Spacebar for Vim mapleader

I am wanting to use the spacebar for my mapleader, but the only problem is that every time I use the spacebar while typing it is trying to be my leader and causing a slight delay. Is there anyway to ...
1
vote
0answers
19 views

How do I handle HTML5 input type date with localization?

I have some date fields in my application (backed by rails) and my locale is pt-BR (dd/mm/yyyy). I know that some browsers (e.g. Chrome) support input type=date and in these browsers I would like to ...
0
votes
0answers
9 views

How do test the form popped up by turnip?

If you click on the icon,the Form Popped up. This form is set default number '0'. And this form is written 'Set the target value.'. Input '123' and Press Enter key. I tried test this form by turnip. ...
0
votes
1answer
26 views

How do I turn an array of strings into a select drop down menu in a Rails/JavaScript file?

I have a menu where I select a time slot and a JavaScript function is called. $('#timeSlotSelect').on('change', function(event) { alert($(this).val()); var time_slot = $(this).val(); var i = ...
0
votes
1answer
17 views

use jQuery in Backbone.js through event, not working

I'm trying to get a click event to execute a jQuery action in a Backbone view. This is my Backbone view class Movieseat.Views.MovieseatsIndex extends Backbone.View template: ...
1
vote
2answers
35 views

Make hidden input field visible HTML Javascript

Html input field is inside anchor tag like so .. <a id="brand" onclick="myFunction()" class="brand" ><input id="mytext" onclick="myFunction()" type="hidden" value="Anchor Title">Anchor ...
0
votes
0answers
17 views

Is there a way to tell Turbolinks as portion of the page has updated

I have dynamically added a div onto my document with ajax and I need to tell turbo links the page has updated. I would like to keep using $(".comment") instead of $(document) because the the .arrow ...
1
vote
1answer
13 views

Braintree Drop-In UI requires reload to work properly

I'm just getting started with the Braintree drop-in UI. Client side is javascript, server side is ruby on rails. My system is very simple right now. The user is given a list of invoices that pertain ...
0
votes
1answer
20 views

Runnig Rake tasks on production server failes due to ExecJS

I have a Rails 4 application installed on RHEL 6 machine. The production uses Passenger and Apache2. Lately I've been trying to integrate Rake tasks into production as a scheduled job using Whenever ...
1
vote
0answers
22 views

dynamically add contols in ruby on rails form using javascript

I am trying to add controls dynamically using javascript add button. It is working fine with simple strings in javascript as follows: var input=""; input2 = "<select ...
0
votes
0answers
16 views

Generating Images from Canvas, security exception in every browser except Firefox

I'm using Amazon::S3 for image uploading. When I use those images in canvas tag and then if I try to generate data image from canvas after that it gives me security exception of CORS request. Please ...
0
votes
1answer
27 views

Change a class parameter in javascript object

I'm using this wonderful gem by Chris McCord, Sync My project is working fine, except for small issue relates to a position. In the coffeescript file of the gem I have class Sync.PartialCreator ...
0
votes
0answers
10 views

Use dataTables or filter and paginate in Rails?

I've like 6 or 7 controllers in which I've to show a list of elements in a table, that must be paginated and searchable. I've seen a Javascript library called dataTables that allows to do both things ...
0
votes
0answers
34 views

jQuery button not always triggered

I have this simple rails app that when you press a button it counts a number. Sometimes it happens that the click event is not recognised on a mobile device, but I can't figure out why this is ...
0
votes
0answers
15 views

How to upload an image in a Rails app that will be saved via another Rails app (API)

I am fairly new to Rails, so please let me know if you need more information or clarification. Thanks in advance. I have two rails apps. For clarity, I will call them myApp and myAppAPI. I need to ...
0
votes
0answers
14 views

head tag repeating in body with ajax call on rails

I'm new to ajax and I'm practicing a bit but I keep getting this kinda error which I can't seem to find an answer anywhere. I am at the index page and I want to load another page body with ajax for ...
0
votes
0answers
10 views

translation missing error in javascript file from rails

I am using the i18n-js gem for internationalization messages for client side validations and any JavaScript custom messages in my rails application. Here, I could able to get the current locale in ...
0
votes
0answers
8 views

CoffeeScript - Sharing data between files in Rails application

in my Rails application I have two views that produces charts based on flot charts and this post Now, these two pages are different in only plotNames array. This is obviously a bad implementation, ...
0
votes
1answer
45 views

If you assign Javascript to a button that is already issuing a redirect, does that script get executed?

Update I figured out that Turbolinks causes links within your application to load content asynchronously, so $(document).ready() only fires on the first page you visit. Therefore, adding jquery ...
0
votes
2answers
36 views

form submits even when I click cancel in confirm form submission dialog

This might be some stupidity from my part but I cant figure this out. Pls see the code below. <%= submit_tag "Send Request", :class=>"btn btn-primary", onclick:"submit_form();"%> <script ...
0
votes
1answer
21 views

Rails4: How can I change a display position after clicking a link?

I use will_paginate at the bottom of the page. Although the page is displayed after clicking the page number, the position of a scroll remains the same (bottom of the page). I'd like to display the ...
0
votes
1answer
23 views

using ruby on rails tag in javascipt

i am stuck in a problem. I have an html button in html.erb file. This button generates html controls and appends in table. It was working fine when there was no ruby on rails script involved. But now ...
0
votes
1answer
13 views

ruby code being displayed as text rather than executing in js.erb file

I'm trying to find and replace some html code using an AJAX call. The following code in my .js.erb file successfully executes and displays the partial view called 'edit unit' with the resource ...
0
votes
1answer
24 views

Use AJAX to display multiple partials

I feel like this should be really simple... I make an AJAX call, where I send an array of strings (defined in my call-back function in my controller) to a .js.erb file: In my rails controller: ...
0
votes
0answers
13 views

Social share buttons not loading when changing page in rails

I use the social share buttons for twitter and facebook. The javascript that turns those divs into buttons dont' show up unless it's the first page I load on, or unless I refresh the page. In other ...
0
votes
0answers
9 views

Saving data with medium-editor-rails

I have install medium-editor-rails gem following this https://github.com/marjinal1st/medium-editor-rails its working perfectly to show the edit box but don't know how to save data through model Here ...
0
votes
1answer
13 views

How to use page/view specific Javascript with Turbolinks in Rails 4?

With Turbolinks enabled, the page keeps all existing JavaScript and loads the new page into the body. If the previous page has JavaScript running with document.ready, this also runs on the new page. ...
0
votes
1answer
20 views

Need to Update Rails model by ajax call with HTML5 contenteditable but instead its creating new record

I am trying to update some plots of a stroy with HTML5 contenteditable option. here is the code. View file# where multiple plots can be modified <div id="editable" contenteditable="true"> ...
0
votes
0answers
13 views

Rails: How to access TimeWithZone in js file

I'm passing a TimeWithZone parameter from the controller to the JS file via a hidden field: <%= hidden_field_tag "end_date", @draw.end_date, { :id => "end_date"} %> Its value is: => ...
0
votes
0answers
21 views

Richtext editor in ruby on rails

I did build a text editor from a guide i found and everything is working fine. I tested the text editor in a normal html document before i did implement it into my ROR app. The editor did work in all ...
0
votes
0answers
22 views

How do I prerender a namespaced react component using the react-rails gem?

(Note: I'm using the 'therubyracer', 'react-rails', and 'sprockets-coffee-react' gems) This is the code for my simple component (Hello.js.cjsx): # @cjsx React.DOM Hello = React.createClass( ...
0
votes
1answer
21 views

Angular — Failed to Instantiate Module

Im trying to figure out the client side of an application. Im using Angular, and when I try to load the page I get Uncaught Error: [$injector:modulerr] Failed to instantiate module Facebook due ...
0
votes
2answers
23 views

Bootstrap jQuery Modal not loading on button click

I'm using Twitter Bootstrap loaded via CDN for my Rails 4 app, and when clicking on a button that should load a modal, nothing happens. If I try to trigger the modal via jQuery I get the error: ...
0
votes
0answers
15 views

Why did a file's request URL remain the same after the filename changed after precompiling?

In my Rails project, I used the asset pipeline and the JavaScript and CSS files with the MD5 fingerprint are placed in public/ directory after precompiling. This afternoon I modified a.js file in ...
1
vote
0answers
40 views

Hot to respond js in rails if action has no form?

I trying make notification system and have problem I need publish notification to the view with this: track_activity.js.erb <% publish_to "/notifications/new" do %> ...
0
votes
0answers
31 views

form_for fields disables all javascript elements

I have a rails 3.2 application. On one page I have some javascript to show hide divs. That works fine and dandy. However when I add some fields it seems all javascript events are disabled, for the ...
-1
votes
1answer
16 views

stubbing using get method of a model basing on attribute

fileModel=new Backbone.Model({ "filename":"HigResolution4.jpg", "uuid":"798643982", "uploaded_by":"xyz", "pixel_width":800 }); filenameStub=sinon.stub(fileModel,'get("filename")',function(){ return ...
0
votes
1answer
33 views

How to auto save highcharts as image in specific folder

I am creating chart using highcharts and rails, i want to save chart under app/assets/image/ folder
0
votes
1answer
25 views

Rails best way to initialize function in Javascript after ajax and document ready

The question is that there are some functions that I call to initial some elements on the page. But after ajax success, I have to re-call those functions again and again in multiple places. I was ...
0
votes
0answers
8 views

How to build a two level grouped_collection_select to use ids, not text as the identifier

I am using the grouped_collection_select to build a three tiered dynamic menu structure. The tiers are State, City and Location where the user action is: Select a state, and the city menu changes to ...
0
votes
1answer
17 views

setting up dropzones programmatically in rails. getting Can't verify CSRF token authenticity when trying to upload a image

i'm having trouble with dropzone in rails. i'm getting this error when I try to attach a photo Started PUT "/artists" for 127.0.0.1 at 2014-10-09 15:47:06 -0700 Processing by ...
1
vote
0answers
36 views

bootstrap-gallery, activating plugin on gallery container

I'm attempting to use bootstrap-gallery in my rails 4 app. I've followed the simple instructions outside of not understanding what is meant by: 3. activate the plugin on the gallery container ...
0
votes
0answers
21 views

Ruby on Rails adds additional Backslash to Unicodes read from another CSV

I have a CSV file which contains some unicode characters that I want to display on the screen. Here is a screenshot to the unicode file. http://i.imgur.com/lBvXBOL.png Here is my ...
0
votes
1answer
15 views

add slide function to multiply items

I added jQuery Mobile v1.2.0 to our manifest to add slide funtion for mobile devices. This is my show accommodation template: :javascript $(document).ready(function() { ...
-2
votes
0answers
30 views

414 (Request-URI Too Large) [duplicate]

I am using Server:nginx/1.6.2 and when I pass large uri from javascript to rails controller, it fails with status code 414 - "414 (Request-URI Too Large)" I tried to change /etc/nginx/nginx.conf file ...
1
vote
1answer
23 views

Using rails how to synchronize variable in controller to the view where the controller is the initiator of the update [closed]

I tried the long polling in AJAX, where the client calls the server requesting data at a certain interval. - The updating of list in UI was initiated by the client Below are the code: ...
1
vote
1answer
25 views

Jquery works in console but not Rails 4 application.js file

This is my html markup: (in welcome/index.html.erb) in a Rails 4 project. <div class="bottom-bottom-box box"> <div class="miv-box"> <span class="five-yr ...
1
vote
2answers
21 views

jquery not running with rails in external js file

i am using rails and trying to call jquery code present in external js file whose path i have specified correctly in my html file.The jquery code is executing correctly when i include it directly in ...
28
votes
4answers
16k views

Couldn't find file 'jquery-ui'

I am getting the following error even if i have jquery-ui in my application.js file couldn't find file 'jquery-ui' (in ...
25
votes
5answers
17k views

Twitter bootstrap modal input field focus

I have the following modal form from example: <!-- Button to trigger modal --> <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> <!-- Modal ...