Tagged Questions
0
votes
1answer
37 views
Change input value based on
In my Ruby on Rails application I have table with car prices. This table has the following inputs:
Car from_days
Car to_days
Car netto_price
Car brutto_price
I have the following html code(I ...
0
votes
0answers
16 views
Using html5up template on Rails
Hi I am new to Rails and web development in general. I want to implement a template that I have gotten from http://html5up.net/. The template is Big Picture.
Html5up.net uses a skel.js framework ...
0
votes
2answers
20 views
Create a record in Rails from AngularJS
I have an Angular application that sends http requests to a rails server. I'd like to make a request to create a record (in the table SavedQueries).
The Angular app is actually making a very simple ...
3
votes
1answer
29 views
Can you use AngularJS with Rails Models
If the title question is unclear, let me clarify. Though the question is conceptual, rather than physical.
I have a rails application with a few models (order, buyer). I recently discovered angularjs ...
0
votes
1answer
14 views
AngularJS application not downloading file
I have a rails server that generates a csv from an http request, like this:
@results = some_json_string
require 'csv'
csv_string = CSV.open("results.csv","wb") do | csv|
...
0
votes
1answer
11 views
Rails app not loading Arbor.js once deployed to heroku
We're building a rails app and using Arbor.js to display a node graph on the web page of the rails app, and it works fine on localhost, but when we deploy, we get the following errors.
Resource ...
0
votes
0answers
32 views
Append a variable in ROR using Javascript or Ajax
Excuse me for very dumb question, I am very new to Ruby On Rails. Am trying to Create a mockup of a page, the page has two Views, Product View One and Product View Two. There is a small Content ...
0
votes
1answer
33 views
interpolating a '#' in a rails url
I have a a webpage which has different tabs. The tabs used to be different pages, but now through angularjs they are effectively a 'single-page' with no loading between each clicked tab.
So every URL ...
2
votes
1answer
23 views
Backbone-rails model referencing with sprockets
I have this backbone application built on Rails with sprockets, and I'm using backbone-forms and associations. The files (models and collections etc) are included in a certain order (thanks to the ...
-4
votes
0answers
38 views
Ruby on Rails - How to use JavaScript in before_save filter? [on hold]
I want to have some JavaScript in before_save filter to play with item inner html.
Something like:
before_save do
$(function() {
// JavaScript
});
end
How can I do that?
Thanks
0
votes
0answers
17 views
form_tag does not work in js.erb
I'm writing a page where user will answer question one by one. and when the final question is reached, the "next" button will change to a submit form (i use ajax to replace the "next button link" with ...
0
votes
0answers
13 views
Angular - Performance/Crawl-ability - Json to Jeykll - Thoughts? [on hold]
I've considered a rebuild of Lionseek.com (Moving from CodeIgniter to ROR + AngularJS) - millions of pages/millions of pageviews a month/updated every minute or so.
Since most of the traffic is ...
1
vote
2answers
30 views
XMLHttpRequest No 'Access-Control-Allow-Origin' header is present on the requested resource
So there are a handful of questions on StackOverflow addressing this error, but of the 10-15 I checked, I could not find a solution to my exact problem.
I am running an Angular app (port 9000) and a ...
0
votes
1answer
16 views
jQuery hide html column with button click using link_to on rails and HAML
I'm trying to hide an html column with a click of a button with jQuery hide method.
Here's my html:
%br.clear
- @cards.each do |card|
%div{class: "hide_#{card.id}"} <- added this to solve ...
0
votes
1answer
11 views
Rails AJAX delete functionality working but not removing itself until refreshed
I'm trying to delete using AJAX with :remote => true on my link_to
The delete is working fine, getting 200 response, and when page is refreshed item is no longer there.
[30/Jul/2014 11:26:57] ...
0
votes
2answers
23 views
rails and javascript, know if the user has confirmed a dialog
In my rails 3.2.17 application, i have a delete button:
<%= link_to 'Delete', destroy_item_path(@item),
method: :delete,
data: { confirm: "Do you confirm?"},
id: "a_delete"
%>
...
1
vote
1answer
19 views
Get rails variables as parameter to an onclick event function
I'm trying to do something: I have a event listener to call a function when a button is clicked (there is a dynamic amount of them), but I would like to pass an additionnal argument to the function ...
0
votes
0answers
16 views
How to fake JavaScript time and timezone in Cucumber tests?
In a Rails app, I am trying to write a Cucumber test for a page that displays an event's start time. The time is stored as UTC in the database, while an event.js script that runs on the page computes ...
0
votes
0answers
10 views
Rails caching javascript webapp incorrectly
I have a web-based game. At the end of the game on the page /games/:game_id_slug, the user is presented with an option to play another random game set. This is only seen at the end of the game.
When ...
0
votes
1answer
12 views
How to install jschr's bootstrap-modal in Rails
I'm trying to install jschr's bootstrap-modal found here: https://github.com/jschr/bootstrap-modal to use in my rails project.
The github page's instructions indicate to:
Include ...
0
votes
2answers
37 views
sharing document.ready javascript between pages
I have a lot of $(function () {}); (document.ready) javascript functions that are the same across my different web pages. However I don't know how to 'share' them such that I can keep them all in one ...
0
votes
0answers
16 views
Token Input refactored, now won't search
$('.token_input').each ->
t = $(this)
t.tokenInput t.data('url'),
crossDomain: false
prePopulate: t.data('load')
preventDuplicates: true
minChars: 4
theme: ...
0
votes
1answer
32 views
show and hide using Javascript in a Rails app
I am new to JavaScript and rails. I am building a site in ruby on rails and I am trying to use JavaScript in a view. I need to hide and show some elements of a table I have some script task down and ...
0
votes
2answers
35 views
Attributes not passed to AJAX call for cart items
I am new to AJAX. I have the following Ajax call with a view below:
:javascript
$(function(){
$('.select').change(function(){
$.ajax({
url: "#{update_cart_path(format: :js)}",
...
0
votes
1answer
15 views
rails fixed header table with varied width
I'm trying to create a fixed header table in my index view.
After 2 days I'm on it, I finally found the jQuery 'fixedheadertable' addon, and I still can't use it.
I guess I'm doing something wrong ...
0
votes
0answers
5 views
Picture Polyfill in Rails 4 with Asset Pipeline
I'm trying to use Picturefill polyfill in Rails 4 https://github.com/kristianmandrup/picturefill-rails this example markup will not be honored by Rails 4 asset pipeline, though I did 'gem install ...
1
vote
1answer
25 views
Javascript window.open returns undefined
I have a Rails 3.2 site and am using a javascript print routine that has suddenly stopped working. Here's my print routine code:
function print() {
var mywin = window.open('', '', '');
...
0
votes
2answers
35 views
rails endless scroll with kaminari, event not triggering
Fallowed the endless scrolling tutorial by Ryan Bates, and don't understand why it's not working ;/ partial does not update
localfeeds/show.html.erb
<div class="row">
<div ...
0
votes
2answers
27 views
Repopulate Angular app data with new data from form submission from a rails api
I have a rails api that sends default input to an Angular app. The angular app receives json at localhost:9000/api/query, and then the view at localhost:9000/#/query styles that json into an unordered ...
1
vote
0answers
23 views
Making code using JavaScript for dependent selects RESTful
Ruby 2.0.0, Rails 4.0.3, Windows 8.1 Update, PostgreSQL 9.3.3
I have code that uses JavaScript to power dependent selects. To do so, it references a controller method that retrieves the data for the ...
0
votes
2answers
34 views
Rails fill table with Model dynamically
I have a problem with Ruby on Rails.
I have a "Host Model" with a method, which takes longer to run.
class Host < ActiveRecord::Base
def take-a-while
#do some stuff
end
end
Now I ...
0
votes
0answers
79 views
Is there an unobtrusive javascript utility library? [on hold]
I want to make a checkbox to do the reversely select function.
Result in some code like this:
$('#check_all').on("click", function(){ $('input[type="checkbox"]').click(); });
But I do not want to ...
1
vote
1answer
51 views
Building a web app for time effectiveness: Rails, Django, Node or alternative [on hold]
I've started learning Rails, Django, and Node.js. and I've found that learning to use these frameworks takes an enormous amount of time.
Because Rails and Django have so many parts the complexity ...
1
vote
1answer
23 views
My ng-change is not firing on my Angular/Rails app
I am building a notecard application and for some reason my ng-change is not firing at all. I cannot figure out what the issue is. I tried breakpoints in the JS to verify that it is not actually ...
0
votes
2answers
43 views
Why is this javascript function from an externally linked file undefined in my Rails view?
I've written a view that lives in app/views/jobs/show.html.erb and if I add the following code into my HTML everything works as I expect it to:
<script type="text/javascript">
$(function() {
...
0
votes
1answer
25 views
Include javascript on specific pages using Rails 3
I have created service for live chat using Ajax and Rails, where I send ajax GET requests to server and receive responds . Anyway, I want that Ajax script works on every page except on home/chat.
So, ...
0
votes
1answer
25 views
Highcharts Column w/ drilldown not working in Rails 4
Ruby 2.1, Rails 4, using Highcharts to build a column chart with drilldown. Locally, when I click on the chart and try to get it to show me the drilldown functionality, it doesn't work, but when I ...
0
votes
1answer
10 views
Rails fields_for enumerate with id
If I have a standard fields_for method such as:
<%= f.fields_for :exptypes do |builder| %>
<%= render 'exptype_fields', :f => builder %>
<% end %>
Is there such a way to ...
1
vote
1answer
16 views
Why is my embedded ruby json string encoded with html entities when parsed in the view?
I've created a rails action that makes a GET request to a service and then passes the response to the view as @job_data. The code works fine in retrieving the response, and I've verified the json ...
-1
votes
0answers
23 views
Javascript not loading on form error in Ruby on Rails [closed]
I have a ruby on rails site and I have some javascript on a _form.html.erb page. When there is an error on the form, it redirects back to the form page and displays the errors on the top. When this ...
0
votes
1answer
33 views
React is not defined
I just started to play around with the react gem but I seem to running into issues. With the code below, whenever I get routed to my react example page, I notice in the browser developer console, it ...
0
votes
1answer
15 views
How to use a function from one CoffeeScript module in other one? Rails 4 [duplicate]
There is the following question: I have some shared JS function in shared.js.coffee module. I want to use these functions, for example, in module some_actions.js.coffee. So, but I don't know how I ...
-1
votes
1answer
35 views
How to use JavaScript variable in Haml?
I have a javascript function (available on all pages as it's included in application.js) that detects if the browser has Flash support and outputs true or false.
Now, I want to show a flash based ...
1
vote
1answer
62 views
Why not precompiled js and css files
When deploy server not compiled stylesheets and javascripts. Until the last moment Asset compiled. Ruby 2.1.2p95, Nginx, Unicorn.
My Assets path:
app
--->assets
----->javascripts
...
2
votes
3answers
45 views
Where to place the script that is accessible in multiple pages in rails?
I have three functions say add(), subtract() and multiply() and I have two pages using the same function in script and I want it to put it somewhere common so that it is not repeated. I tried to put ...
0
votes
0answers
24 views
RoR bug (in my code) in firefox and chrome but not in IE?
I have some coffeescript:
http://jsfiddle.net/jdell64/9v646/
that utilizes the jquery ui datepicker. On page load it gets an array of available dates (one month at a time) and displays them. This ...
0
votes
1answer
20 views
Opening a modal inside of a tabbed nav - Bootstrap 3 & Rails 4
I have a tabbed navigator on a page of my site. The navigator appears fine, but in one of the tabs, I have a table that has a "Mark Complete" button on each of its rows. Each button opens a modal.
...
1
vote
1answer
35 views
Send email with rails 4, mail form, and ajax?
I am working on an app that has a contact form. It is a single page app, and I am using rails on the backend, and angular (not for the form) and bootstrap on the front end. I am trying to use ajax so ...
0
votes
2answers
24 views
How to send an http request with parameters to rails from javascript
I'm attempting to test a sample project at
http://162.243.232.223:3000/api/query
This is a rails project.
The rails controller is looking for a params hash like params[:query]['input']
In ...
0
votes
2answers
36 views
JS (Coffee-Script) is not working in rails app
I am writing a simple code like:
ready = ->
$('div').click ->
$(this).append "<span style='color:#f00;'>olol</span>"
$(document).ready(ready)
$(document).on('page:load', ready)
...