ruby-on-rails

Rails redirect with https

Hi everyone, I'm maintaining a Ruby on Rails site and I'm confused as to how to perform redirects to relative URLs using the https protocol. I can successfully create a redirect to a relative URL using http, for example: redirect_to "/some_directory/" But I cannot discern how to create a redirect to a URL using the https protocol. I...

varchar Migration question for Ruby on Rails

I have created a new table including a column "note". The default is varchar(255) I believe but I wish to have this column be a text area vs. a field and to allow more data. I imagine that I would make this change in ActiveRecord::Migration file but I am curious as to the format. Do I simply change the varchar(255) to varchar(1000) for e...

Drop Down Box - Populated with data from another table in a form - Ruby on Rails

I am attempting to add a note capability to my CRM that I am creating.I am employing an authenticated environment where users can manage their prospects. For instance, I sign up, I login, I can enter prospects and view them. So...I have created a prospects and user table and have them all working great. I am now trying to give the users ...

Help with rails routes

I seriously cant understand why this is so hard... I have some experience with other mvc frameworks but always heard rails was the easiest to code in.... right now I cant even get to my controller methods if i want to. I used scaffold to creat 'student' which automatically created for me the controller, model and views for basic CRUD.. ...

Rails app in different language?

I want to create my app using spanish controllers/methods. can I use scaffold? scaffold created methods like new, create, edit, etc I want to change those to be nueva, crear, editar, etc when I do that the app breaks because of REST routing rules whats my best approach to this? please help. ...

Automatically Refreshing Rails Metal In Development Mode

I am trying to develop a rails metal endpoint using sinatra, but is proving to be a pain because I have to restart the server every time I change the code. I am in Jruby and running from within a larger Java app. Is there an easy way to make this code refresh for every request? ...

How to handle Ruby on Rails error: "Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'"

Running a Ruby on Rails (RoR) app or Ruby code which uses the ActiveRecord framework, you get the error message: Please install the postgresql adapter: gem install activerecord-postgresql-adapter Trying to run: gem install activerecord-postgresql-adapter also fails, leaving you at a loss. ...

acl9 roles deleted if no user

So for whatever reason this plugin will not maintain a role if there are no users added to it. A role whose last user is removed gets removed from the roles. Is there a workaround for this? ...

Where do I insert my Rails URL in the JQuery Autocomplete to reference the data set I want?

Where do I reference my controller (Rails) URL to show the dataset that I want in the autocomplete via JQuery? Here is my head: <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js"&gt;&lt;/script&gt...

rake: command not found

I'm trying to install rails on Ubuntu 9.10. gem list --local *** LOCAL GEMS *** actionmailer (2.3.4, 2.3.2) actionpack (2.3.4, 2.3.2) activerecord (2.3.4, 2.3.2) activeresource (2.3.4, 2.3.2) activesupport (2.3.4, 2.3.2) rack (1.0.1) rails (2.3.4, 2.3.2) rake (0.8.7) sqlite3-ruby (1.2.5) rake The program 'rake' is currently not insta...

Gem::RemoteFetcher::FetchErro when installing rails

Hi, I am trying to install rails on Ubuntu 8.10, and met following errors. Please help me get through.Thanks. root@pierr-desktop:~# gem install rails ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response 500 (http://gems.rubyforge.vm.bytemark.co.uk/gems/actionpack-2.3.4.gem) #other information root@pierr-des...

What is the best way to geocode large sets as a background process in Ruby on Rails?

I am implementing a contact importer and will be geocoding the contacts that are imported. If a user imports 1000 contacts, geocoding is way too slow. Essentially I would like to start a background process to geocode the contacts after they are imported and somehow report the status to a log. Does this sound like the best way to do ...

Rails form_tag spanning partial and ActionController::InvalidAuthenticityToken

Using a :partial for the start of a "form_tag" and the "end" in a different :partial gave "compile error" and "syntax error, unexpected kENSURE, expecting kEND". Changing the "form_tag" to a standard HTML "form" tag fixes that but gives "ActionController::InvalidAuthenticityToken". ...

Best way to display a Twitter feed (with history) on a Rails site

On a Rails site, I'd like to display a certain Twitter feed, with pagination so the visitor can see previous tweets (as far back as needed). I implemented it using the Twitter gem, using Search method, which has a nice pagination method, but hit a limitation that Twitter will only return the statutes from the last two weeks. So after go...

Where would I place custom classes and how would I access them?

I have the following class that I'd like access to within certain controllers in my app: class Spreedly include HTTParty base_uri 'https://example.com/api/1234' basic_auth 'user', 'xyz124' headers 'Accept' => 'text/xml' headers 'Content-Type' => 'text/xml' format :xml end Where would I put that class so that I could then...

zooming image in ruby

Can anyone tell me the way to zoom the image in Ruby on rails please ? ...

SMS using Rails in India

Is it possible to send SMS in india using rails applcations? If so, can you provide an example? I checked for the clickatell but I think it works only in Australia or the UK. ...

Is this a bug in Vestal Versions or am I doing something wrong

I think I might have discovered a bug in Vestal Versions (http://github.com/laserlemon/vestal_versions) -- it seems like revert_to's behavior depends on the reverts I've done in the past with the same object. Here's an example: >> a = Annotation.find(1384) => #<Annotation id: 1384, body: "Just hanging out -- \"playing possum\" -- at th...

`accepts_nested_attributes_for` attributes not getting cloned

I want to create a new instance of a model, however I want to bring some parameters from a different record also, essentially duplication most of the parameters into the new instance but leaving some fields blank as well. Cloning it works (thanks @weppos) # class RecipesController def new @parent = Recipe.find(params[:parent_id]) @...

Has anyone successfully deployed a Rails project with Ruby 1.9.1?

Last week I successfully completed the transition of all our company applications from Ruby 1.8.6 to Ruby 1.8.7 including local and remote configurations. From now on, development won't need to ensure backward-compatibility with Ruby 1.8.6. For the sake of curiosity, I tried to run the test suite of a couple of projects against Ruby 1.9...