ruby-on-rails

Ruby on Rails or a PHP framework

I am a capable programmer and I write software for a living. I am taking up a new project to build a website that has a bunch of forms that perform CRUD operations on a database and some multimedia. I am very familiar with PHP and Python and have written some websites in them. I have written some rake tasks and a few ruby scripts that ru...

How do you indicate where the form_tag is submitted to in Rails?

I'm new to Rails and am not sure how to specify where the form_tag submits to? <% form_tag do %> <%= submit_tag "checkout_submit" %> <% end %> In the case of the example above, does this form submit itself to the "checkout_submit" action from the same controller that rendered this view? ...

Problem starting development server - ruby on rails

Hi I've recently upgraded to Rails 2.3.2 with Ruby 1.8.7. Whenever I start the server like this: cd /myproject script/server It hangs. After I cancel it the only error information that I see is: ^C/Users/timstephenson/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/load_error.rb:32:in `new': Interrupt The error ...

Rails, One Model, Many Screens

I have a model with many fields (nearly 40). The client wants the fields divided among multiple screens. The model also has a few has_manys that should look like they are part of the same model. How can one divide the model, and what are the tradeoffs among the ways to do it? I see a couple of possibilities: 1) Use JavaScript to show ...

Not java based editor for Ruby on Rails on windows?

It appears that NetBeans and Aptana/RadRails are the most common adopted IDE's for Ruby on Rails development, but both needs the Java Runtime Environment to run. I'm looking for an IDE wich doesn't need JRE to run. If it is lightweight and installs very fast would be better, because I will be programming in computers with old hardware a...

dynamic table names for Active Record models

I have an interesting Active Record problem and I'm not quite sure what the cleanest solution is. The legacy database that I am integrating with has a strange wrinkle in its schema where one logical table has been 'partitioned' into several physical tables. Each table has the same structure, but contains data about different items. I'm ...

RoR tutorial for very simple forum?

I am debating whether to integrate an existing RoR forum...or if there's a simple RoR forum-creation tutorial that I could use to just put the basics...it's a side-function to the main application. Can someone offer a suggestion? ...

Converting pdf to images using Ruby/JRuby

I'm looking for an easy way to generate previews for labels generated as pdfs. It would be great if I could convert these pdfs to images and show them to the user before the actual print/download. The application is currently running in a Jruby on rails environment, but it's quite possible that we switch to two applications, one running...

Advice request: Serve local folder through rails (or not?).

Hello, The task: Serve the files located in a local folder on the server to clients over http/80. In the end, I plan to emulate the folder on the client but that doesn't concern my question. So, there is an existing Rails app (rest based/xml) on that server that the clients would use in conjunction with these files. I don't need any l...

What's faster for getting Mails into Rails: Pop3 / Imap or direct MySQL query?

Hi, I'll rewrite a different question of mine, because the problem case somewhat changed: If I want to get mails from my mailserver (different machine) into my Rails App to process it there, what is faster: Connecting via net/Pop or net/imap to download the mails Storing the Mails on the Mailserver in a MySQL Database (using somethin...

twitter authentication in rails app - logging off

I've implemented twitter authentication in my rails app, on my local dev box. However I'm not able to get the application to log off. Isn't it enough to clear these two cookies? remember-token and -twitterauth-session? ...

Selecting only one row from child model based upon the parent model

Following is the association between 2 models: class FotoGossip < ActiveRecord::Base has_many :uploads end class Upload < ActiveRecord::Base belongs_to :foto_gossip end @latest_uploads = Upload.all(:include => :foto_gossip, :order => "created_at DESC", :limit => 5) It displays the latest 5 photos from Upload model. But, I want...

What are main advantages of RUBY and RAILS to PHP and CODEIGNITOR

We are about to start a new Web2/AJAX app and are trying to decide if its worth the time and effort learning Ruby/RubyOnRails instead of PHP, CodeIgnitor and JQuery we currently use. The key issues are clean/fast/modern AJAX UI, robust error handling, ans maintainability. I would appreciate unbiased (if thats at all possible talking la...

Rails on VIM with no files open

I recently started using (Mac)VIM w/ Rails on VIM plugin. My workflow is following: 0) open VIM in project's path 1) open new tab in VIM 2) open any file in project 3) do what i need w/ Rails on VIM Do you have any ideas how to skip 2nd step so that i could run R* commands straight after opening a new tab? Open some placeholder ({PRO...

sort list of objects by property on associated object

Can I sort a list of objects by a property of an associated object? For example with the following class class RosterSlot < ActiveRecord::Base belongs_to :event belongs_to :skill belongs_to :person end I want to do something like RosterSlot.find(:all, :order => skill.name) which means activerecord needs to do a join and or...

Can 'cucumber' run my rspec-on-rails tests?

I have a small test project that I'm using to test the waters for a much larger project. I am using rspec on rails for testing, but recently looked into Cucumber. It looks very nice, but I'm wondering if there's a way for cucumber to run my spec tests, or for rspec (autospec) to run my cucumber features. I've looked around extensively...

Problems re-populating select options in Rails when form returned with errors

I have a form with 2 select options in it -- frequency and duration. When there are errors with the form, and it is returned to the browser, the select options are not re-populated with the selections the user made even though the returned values for those fields match the values of options in the selects. Also, when the form is returned...

do you use Heroku to write Ruby on Rails app?

do you use Heroku to write Ruby on Rails app? i read about from the book Learning Rails from O'Reilly, and then today found that http://heroku.com/myapps doesn't have a "Create App" on the page so that I can edit the code online any more. Do they only allow that for the paid user? It also seems that they only let you have one web requ...

Reduce Mongrel Rails Memory Footprint & Increase performance?

My rails sites run Mongrel, I am having a problem with the amount of memory being used. My ruby-bin processes are using up about 66 MB of resident memory. How can I reduce the amount of memory used by rails? It is not very economical to have many rails servers running on a single machine if they are eating memory at this rate. My php...

For an ActiveRecord one-to-many association, which :foreign_key option should I set?

ActiveRecord's has_many and belongs_to methods both take a :foreign_key option. If I need to use it to handle a nonstandard FK column name, should I set it for the parent model (has_many), child model (belongs_to), or both, or does it matter? ...