I have a model Locations with two columns latitude and longitude. I want to find a way where I can get the list of locations and pass them to google maps using Ajax and javascript. So far my code is as follows:  map.js:  function initialize()  {...
I'm using ckeditor in my rails projec and I have a problem with image uploading. I don't want everything that ckeditor have, that I wrote some simple config.js for it:  CKEDITOR.editorConfig = (config) ->   config.language = 'pl'...
I want to know the content type of a given url input by the user inside my Javascript code. Actually, I have a drop-down list (html,csv,xls etc.) and I want to make it so when the user inputs an url, I want to detect the type of the content of the ur...
I'm using Rails 3.2.9. When I add CoffeeScript code to a .js.coffee file in the /app/assets/javascripts directory, I get the resulting JavaScript in all of my webpages. The problem is all the JavaScript is wrapped in:  (function() {   // my code...
I'm trying to get some RJS code written with prototype and Rails 2.3.11 to work in Rails 3.2.1  I have the prototype-rails gem, so render :update do |page| works, I'm using a form with :remote => true that sends an ajax request to the cont...
I have a yml file and i need the keys to be used in the application.js file in the scripts. I cannot able to access it from the script. Please help me. I have the following lines in the initializer  APP_CONFIG = YAML.load_file("#{Rails.root}/conf...
I have a Ruby On Rails(Ruby 1.9; Rails 3.2.13) application. I am trying to create charts using Highcharts. But i am getting an error on browser as Sprockets::EncodingError in Product#index sample/app/assets/javascripts/highcharts.js has a invalid UTF...
i have a jquery function that displays a hidden content on each element in the loop of elements. This work perfectly, but the problem is that when i append new elements to the loop it stops working. It actually works on some elements and doesn't...
I have a js.erb file in my Rails app that will be included as an external script by another site. I would like to define a variable that stores the absolute URL of the Rails asset path (protocol + host + asset prefix) such that the URLs look somethin...
I am trying to build custom remote validator using client_side_validations based on this tutorial. So far I have this:  config/initializers/custom_validators.rb  class JobsOverlapValidator < ActiveModel::EachValidator   def validate_each(record, a...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.