ruby-on-rails

What is the basic setup on SVN to work on a Rails app?

Lets say, i setup my svn host, like: http://www.xxx.com/svn Then I create my project at a folder like: /home/me/workspace/my_app I want to Setup my svn client and ignore files like tmp/* log/* db/schema.rb and such, so what are the commands on console for that? If possible can you write what the full sequence of commands to set this up...

Allow user to delete own account - Authlogic

I am trying to make it such that a user can delete their own account. def destroy @user = current_user @user.destroy redirect_to root_url end But it looks like authlogic will not allow the current_user to delete their own account. Any ideas? ...

will_paginate -> How to change the default url?

will_paginate plugin aways generates the pagination to the current url appending the page parameter. Is there a way to change this? I need it to paginate to another controller/action plus some arguments. ...

class variables and module inclusion, specifically in ActionController

I want to have some kind of single list that is initialized in a seperate module, then can be included in a controller and modified at the controller-class level, and accessed at the controller-instance level. I thought class variables would work here, but something strange is happening, they don't seem to be being initialized within my ...

starting with ruby on rails

i want to download ruby on rails, but i am not understanding what to download here? http://rubyonrails.org/download i would like to get ruby on rails and i have windows. which one should i download? ...

accepts_nested_attributes_for doesn't work propertly for has_one relationship

I'm having trouble with accepts_nested_attributes_for in a has_one relationship. The models: Purchase and Sale. class Purchase < ActiveRecord::Base has_one :sale, :dependent => :destroy accepts_nested_attributes_for :sale end class Sale < ActiveRecord::Base belongs_to :purchase end In the controller/new action: @purchase =...

Submitting a rails remote_form with external submit button

I'm trying to submit a rails form using a submit trigger that is outside of the form tags. So I have my form: <% remote_form_for Package.new, :url => { :action => :rate_shop, :ids_sales_order_id => params[:ids_sales_order_id], :id => @shipment.id }, :loading => '$("#loading").overlay({api: true}).load(); ' + visual_effect(:appear, 'pri...

Why am I getting nil for a belongs_to relationship in Rails?

I'm having a problem in my Ruby on Rails app with a model where a belongs_to relationship keeps ending up being nil. Given the following models: class Chassis < ActiveRecord::Base belongs_to :model belongs_to :chassis_size end class Model < ActiveRecord::Base has_many :chassis end class ChassisSize < ActiveRecord::Base...

rails - "apache cannot run because another program is using its port"

i downloaded and ran instant rails and i got that message how do i fix this problem? what is the other application that might be using this port? ...

How do I handle an inventory tracking data model in rails with mysql?

Okay, so I am modeling a Datacenter with an inventory of Parts for replacement of failures inside a Server. (present models italicized). I have an InventoryEntries model because I have a swap model that a datacenter enters on a form to record that a replacement part(cpu,psu,fan,bbwc) has been taken from inventory and placed in a server b...

Get results of BackgrounDRB job and update page

Hey guys, I am trying to run a proccess by submitting an AJAX form: <% form_remote_tag :url => {:controller => 'sender', :action => 'send'} do %> <input id="messsageinput" type="text" size="44" name="command"/> <%= submit_tag('Send', :id => 'button') %> <% end %> Then, the 'send' action creates a new BackgrounDRB job and does some ren...

Rails and jquery jcarousel, changes to the next and prev buttons

I want the next and prev buttons to have two uses. First: the standard next and prev through the jcarousel. This I have working. Second, if the user is at the last item in a group, the next button will instead go to the next group. I have Groups with many Projects I am running a loop for the projects inside the Group#show view to lis...

ruby script\generate controller NOT WORKING

this is my first exposure to rails so bare with me please i am following this tutorial http://oreilly.com/pub/a/ruby/archive/rails.html?page=2 i ran this command: ruby script\server i succesfully started the server now when i run this: ruby script\generate controller MyTest it says 'ruby' is not recognized as an internal or exte...

rails: text not rendering

class MyTestController < ApplicationController def index render_text "hello world" end end This is what I am getting when I go to http://127.0.0.1:3000/My_Test/ : NoMethodError in My testController#index undefined method `render_text' for # RAILS_ROOT: C:/rails/rails_apps/cookbook Application Trace | Fra...

rake db:create - getting a syntax error

thank you everyone for helping me out with this. i am new to ruby on rails here is my database.yml file:: # MySQL. Versions 4.1 and 5.0 are recommended. # # Install the MySQL driver: # gem install mysql # On Mac OS X: # sudo gem install mysql -- --with-mysql- dir=/usr/local/mysql # On Mac OS X Leopard: # sudo env ARCHFLA...

1090 error occurs in Flash Builder, but update action works fine in Rails

The below student_request method updates records successfully in Rails but returns "Error #1090: XML parser failure: element is malformed.” in Flash Builder 4 beta. Now the xml works fine for other actions, so I don't think the xml is at fault. It's something in the confirm_request method. Does anyone have any idea? class StudentRequest...

Rendering multiple partials in a controller

I want to render multiple partials in a controller, these will not be part of the response, but pushed to clients via Juggernaut instead. I'm using render_to_string. When the second one is called, I get a DoubleRenderError. How do I render a partial the way that performed? will not be affected? ...

Ruby on Rails: conditionally display a partial

I'm not sure if I'm doing the best approach here, but I have a block of data that I want to show after a search is done and to not be there at all before. First of all, there is nothing to show, and second the model it references is nil so it throws an exception. I placed this block in a partial template and added it the appropriate sp...

using map.root on rails to map to a static path

I'm using static URLs in my RoR project. There is really no controller or action to map to so I tried putting in map.root "/static_page" or map.root "static_page" but I get errors. How do I just map to a path? Edit: I am using a controller to serve up static pages, these aren't html pages, but a static controller I'm using here: http://...

What is the difference between Ruby on Rails and Grails?

Someone asked me to learn Grails and then they said Ruby on Rails. They almost used it interchangeably. What is the difference between the two? ...