ruby-on-rails

HighCharts: How to pass x and y value of selected point to Rails

I am new to HighCharts, javascript, and rails. I have a highchart in my rails application. I need to pass the values of the x and y to rails of the point a users clicks on the chart series. I know about the selection event handler but not how to pass data from highcharts to the rails controller. Can someone point me to an example I can l...

jQuery client validator doesn't work with disable_with option

I can't get jQuery client validator work with disable_with option, <form> <input id="album_title" name="album[title]" required="required" type="text" /> <input class="create" data-disable-with="Submitting ..." id="album_submit" name="commit" type="submit" value="Create Album" /> </form> While I try to submit the form with blank ...

How to properly pass collection for input in Formtastic

I need to pass a collection to the standard select input in Formtastic: f.input :apple, :as => :select, :collection => Apple.all The problem is, though that I need Formtastic to access a different method than name. Now this is really a problem. I can always pass the Array f.input :apple, :as => :select, :collection => Apple.map { |a|...

Change simple app to Rails 3 (looking into the future)

I have just started a simple CMS in Rails 2.3. The application will get more complex in the future (more classes, controllers, plugins, etc) Do you think it may be a good idea to re-write the app in Rails 3? Thanks ...

gem customizations

I added some caching functionality to the geokit gem and used gemcutter to create a copy 'badnaam-geokit'. The only changed are in Geocoders.rb which works fine if I just modify it locally. However, after I published it to rubygems and installed it and require it as 'badnaam-geokit' in my environment.rb (config.gem "badnaam-geokit") fi...

Rails show X image if Case reference is M10-XXX?

Hi Everyone, I currently have a model that the user can upload a thumbnail to the record which is then shown on the show view page. This thumbnail was originally intended so the user could easily find the case when searching through the index view table of records. It has become apparent that users are only using this function to uplo...

[Rails] sending input to params

Hello guys, I come from Grails and I'm new with Ruby-on-Rails. So, I learned that when you create a form_for with a symbol like :user("key"), when submited the params[] receive a new key with ":user" and the respective value from it: <% form_for :user do |form| %> <fieldset> <legend>Password</legend> <label for="curren...

"gem update --system is disabled on Debian" error

When I try to update rubygems (by running 'gem update --system') I get this error: ERROR: While executing gem ... (RuntimeError) gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get. Any idea what might be wrong and how I can fix it? ...

How do I put a link in the middle of a paragraph with HAML?

How do I create this: <p> I would like to make a <a href="foo.html">link</a> in my Rails app. </p> with HAML? ...

mono or RoR for new application run on linux?

I have little experience with ruby itself. I am going to hire somebody to write a web based application and I wanted it to be written in RoR but I was recommend mono. I guess because they like mono and because they think the RoR is slow. The whole application would be some kind of social media meta management tool. There will be front e...

missing the rails gem, redmine install

i'm installing redmine and getting an error, i've commented out the version so it could use any that would load, I originally left it at version 2.3.5 with no luck Missing the Rails gem. Please gem install -v= rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment ou...

Where's my Paperclip doc? Finding the right path

I have a site that saves user documents and I want to use Paperclip to display them using Google Docs Viewer (http://googledocs.blogspot.com/2009/09/view-online-files-using-google-docs.html). Paperclip is working. For instance, I have a file saved at: 127.0.0.1:3000/assets/resumes/51/original/myfile.pdf I want to display that through t...

rails using rjs prototype conflict with jquery

hi all I'm using rails rjs, but I found it doesn't work, when I added "jquery.js" like this <%= javascript_include_tag :defaults,'jquery.validate.min.js'%> but when I changed it like this <%= javascript_include_tag :defaults%> It works, so weird! any helps? Thanks ...

cannot generate routes

hello frens i have a problem as following. i have a resources setup in my routes.rb file as following resources :users do resources :sub_transactions end resources :sub_transactions do collection do get :income get :expenditure end end Now what is the correct route that i should write so that i can generat...

ajax request with form_remote_tag doesn't work

So I'm using a form_remote_tag to attempt an ajax form submission, like so: <% form_remote_tag :update=> 'test', :url=> {:action=>'test_action'} do -%> It renders with no apparent problem: <form action="/pages/test_action" method="post" onsubmit="new Ajax.Updater('test', '/pages/test_action', {asynchronous:true, evalScripts:true, par...

Rails RESTful routes and controller namespaces

I have a namespaced controller like this: class Shop::ProductsController < ApplicationController ... end I would like to route to this controller just as if it were not namespaced. ie. I would like to access this resource through the following URL: /products (ie. not /shop/products) How can I set up this route in routes.rb ...

How to make users have domain name point to their profiles in my site

I want to implement something like Tumblr or Wordpress by giving user the option to have their domain name point to their profiles. For instances user go to their domain registrar and the IP of my server so then: www.usersdomain.com will point to www.mysite.com/userid without actually forwarding so that domain name will still show in the...

Rails if statement results in illegal octal digit error?

Hi Everyone, I have the following if statement in my view: <% if @kase.jobno[1,2].to_i == 10 then %> <img src="../images/2010.jpg" alt="2010"> <% elsif @kase.jobno[1,2].to_i == 11 then %> <img src="../images/2011.jpg" alt="2011"> <% else %> <img src="../images/document.jpg" alt="Document" /> <% end %> It works absolutely perfe...

Getting RAILS to return a dateTime in a specific format?

Hi I have this controller: class SchedulesController "post", :except => :index def index #Schedules.create(:id => -1, :deviceId => "2002", :subject => "Test 2", :scheduleTime => Time.new, :repeatEveryYear => "FALSE") #@schedules = Schedules.all respond_to do |format| format.html # list.html.erb format.json {...

Where is the application.rb file located ?

Hello, Im new to Ruby On Rails.Im using Ruby version 1.8.7 and Rails version 2.3.8.I created a controller SayHello using ruby script/generate controller SayHello The application works as expected, but i cant find the application.rb file. Where is the application.rb file located ? Please Help Thank You ...