0
votes
1answer
38 views

How to implement a word counter in Rails?

I'm wanting to implement a real-time word counter in a form. So as a user types into the box, a line below the box updates with the correct number of words. Here is the relevant form code (my views ...
1
vote
0answers
15 views

How to embed googlebooks search api in view?

I have a code GoogleBooks.search('The Great Gatsby') of this gem that I can work out from command-line. But how do I make search possible from a textfield in view?. One way I know is having a ...
0
votes
1answer
12 views

rails send database vlaue to javascript

I have the following javascript code in rails 3.2. function initialize() { var myLatLng = new google.maps.LatLng(34.553366482, 49.783977595); var mapOptions = { ...
0
votes
0answers
14 views

Carrierwave remote url and choose file validation

If a user chooses a file (photo) and as well as type in a URL for the :remote_image_url I wanted to know how best to validate this scenario or handle this experience? I'm using fileupload js from ...
0
votes
1answer
61 views
+100

Why does my checkout button not work all of a sudden?

I have an app that I have been developing, that used to work up until some recent changes. I ran a bundle update, and a bunch of gems updated. Since then (or around that time) my checkout process ...
1
vote
0answers
16 views

javascript void links with RSpec

My Rails app uses nav pills to change the partial used on a form. %ul.nav.nav-pills %li.active %a{href: "javascript:void()", id: 'post_one_partial', name: 'post_one_tab'} Post One %li ...
0
votes
1answer
22 views

rails require_tree and javascript is not working

My javascripts are not working when i have = require_tree . inside my application.js, if i delete it then my js.erb for a view some_view.js.erb is not working. My application.js file: /* = require ...
0
votes
1answer
18 views

.JS.ERB can't recognize variables

I am new to .js.erb files, and I am using them because I need to construct a Javascript string that needs Ruby variables. Here is my code. pusher.js.erb var pusher = new Pusher(PUSHER KEY); var ...
0
votes
4answers
55 views

Javascript - set input field to 0 when clicked

I have list of input fields within a form tag <div class="angefragte_stunden_<%= hour.id%>"> <%= h.text_field :angefragte_stunden %> code output => <div ...
0
votes
1answer
37 views

Force Literal ASCII character into string

I'm generating the following array for use in a JS charting library: [&#x27;DE&#x27;, 50], [&#x27;GB&#x27;, 9], [&#x27;IE&#x27;, 2] However, I need to force in the ...
0
votes
0answers
19 views

Rails nested form update on back button

I've got a Rails 3.0.x application which has a nested form (people has many current_positions). When I edit, submit and then hit the back button and submit again it used to error, but now I ignore ...
1
vote
1answer
35 views

How to call javascript file in Ruby On Rails

I have two Layouts and each layout have different CSS and Js files. while i use <%= javascript_include_tag 'application' %> then, it brings all .js files. Is anything available like ...
1
vote
1answer
34 views

Too many forms on a page - is it an issue

I am looking for the practice which is most advisable in terms of coding practice I have a comment system which for each comment, you can reply to. This leads me to several options on implementing ...
0
votes
0answers
53 views

Edit item without refreshing page with RoR

I want to edit a Category in the form at the top of the index page when the edit link of a category is clicked and change the 'Create Category' button to 'Update Category'. When you click save, I want ...
0
votes
0answers
32 views

Trying to use panda uploader with ember

I'm trying to use the panda uploader in a rails app with ember.js. The panda uploader is here: http://www.pandastream.com/docs/uploader Something in ember is interfering with the functionality. ...
2
votes
1answer
28 views

How do you make a div show when vimeo video is finished?

I'm really new to JS, and can't figure out these event listeners on Vimeo. Basically I need a div, below the video, to be hidden while the video plays, and appear when the video finishes. Please help, ...
1
vote
2answers
25 views

Saving application user interface options with rails

I'm using a bit of javascript to let users collapse and hide 8 different tables on the main index page. $(".priority-header").click -> //on click $(this).next().toggle() // Hide Table ...
0
votes
1answer
42 views

Javascript within pop-up modal not running

How do I get the bellow code to run within the load of a JavaScript pop-up modal box? I'm using facebox. http://defunkt.io/facebox/ <% content_for :javascript do %> <script ...
0
votes
1answer
62 views

Rerun JavaScript on successful ajax call

I have a delete button with the remote: true option set: # _categories.html.erb <%= link_to 'Destroy', category, method: :delete, data: { confirm: 'Are you sure?' }, remote: true %> My ...
0
votes
3answers
41 views

Javascript not loading latest submitted data

I recently asked this question: Javascript Form Submition? Now I'm trying to work out why, after form submission, the create.js.erb doesn't load the latest data (the data which was submitted). If I ...
0
votes
0answers
47 views

Ruby on Rails: Inserting .js file in asset but still getting no method

This maybe a long shot question to ask, but its worth a try... I have a .js file that I inserted into my vendor/assets/javascript folder and then in my application.js in the apps/assets/javascript ...
0
votes
0answers
42 views

Rails: Having issues accepting multiple products for my order

I seem to be having some issues with accepts multiple products through my dynamic form, I followed a railscast guide, and edited it slightly for my own system. But I am getting an error now, I've ...
0
votes
1answer
31 views

Rails: Dynamically adding products to orders

I'm looking to be able to dynamically add form elements to my order page, so that a user can click a button and be given another element to choose a product with. And then how to handle that with ...
0
votes
1answer
27 views

Get all checked items and delete them using button_to

I have a table with some data and there is also a checbox in each table row and each of them has an unique id like 'chk_1'. There is a button delete. = button_to 'delete', {controller: 'users', id: ...
1
vote
1answer
19 views

File-specific JavaScript in Rails

Right now, in my Rails project, I have in app/views/layouts the file application.html.erb <head> ... <%= yield :javascript_includes %> <%= csrf_meta_tag %> </head> ...
0
votes
0answers
29 views

Jquery datapicker and Javascript stop working after adding bootstrap (gem bootstrap-sass) in rails 3.2.12 app [duplicate]

We added bootstrap (with gem bootstrap-sass) to our rails 3.2.12 app. The format is better. However we notice that all the js features, such as inserting text boxes for new data or inserting a partial ...
0
votes
1answer
45 views

EmberJS Rails API security

Setup is an Ember frontend with a rails backend using JSON api. Everything is going fine but some questions do come up: How do I ensure only the emberjs application consumes the api? I wouldn't want ...
0
votes
0answers
24 views

ActionView::MissingTemplate nested model fields dynamically through JavaScript

I tried to follow this Railscast tutorial. So, basically I have a model gallery that has nested_model with model picture. And I want that admin can add many as many picture as he wants. I followed the ...
0
votes
0answers
21 views

rails format.js AND format.json [duplicate]

Can you force rails to respond to both, simultaneously? I'm calling for json, but I want the .js to fire every time as well. My buddy accomplished this by calling for the js in the response of the ...
0
votes
1answer
49 views

Javascript Form Submition

I'm looking to refresh the the table "dashboard_categories" when I click submit without the whole page refreshing, this is what I've done so far: http://pastie.org/7822560 I'm now stuck on what I do ...

1 2 3 4 5 40
15 30 50 per page