Hi there,
I have a Model (MessageImporter) that connects to a different Database than the other models using self.establish_connection. Everything works fine when I pass the connection info hardcoded. Now I need the connection to depend on the current environment. So I added the info to my application_config.yml (it's a simple nifty_con...
Hello,
The hobo lifecycle tutorial shows how to implement a friendship logic in
the model and controller. However it does not really cover how to glue
the gui/views together. When I go to /friendships/invite - hobo
presents me with a form with a drop down menu. How do I add a form to
the user show-page with just one button (Invite) I gu...
Hi,
I'm working on a ruby on rails project which is developed by someone else rails expert. I don't know ruby well. So while i modifying the existing project, i could not fix a bug because i didnt understand few lines code. It will be great if someone explain. Here are the codes -
on my home controller - home_controller.rb
class Home...
I use MAMP for PHP/MySQL.
What do I need for RoR?
I am using OS X Leopard. I have already installed Ruby, Gems and Rails.
...
Hi,
When running Rails unit tests I get output specifying line numbers and methods when a test fails, e.g.:
1) Failure:
test_05_photo_tag_add_remove(TC_javascript02Test)
[./helper/helper.rb:6:in `handle_assert'
./helper/helper.rb:17:in `check_not_string'
./helper/helper.rb:134:in `check_for_ajax_remove_string'
javas...
I found that I only can @products in the views/products/ folder, I can't call the @products in other position, like views/store ..... .... If I want to use the @products in the view/store, wt should I do? apart from calling /views/products.
...
Hi,
I'm using thinking_sphinx and am delta indexing a model.
The delta index works but there is small bug. When I create a new product it is index. However, when I update that product it is not getting index right away. I have to update or create a new product before that old updated product is indexed.
Not quite sure where to start.
...
I'm developing a Ruby on Rails app where one of my database tables has 10 columns (pile_1 through to pile_10). It would be convenient to access these columns in the model as a 10-element Array.
It feels like I should be able to coerce composed_of into doing what I want, but I can't figure out how. Can anyone enlighten me, or suggest a b...
Hi, I have decided to deploy my app to Heroku and I was following their tutorials. However, Im trying to connect to my Amazon S3 bucket with a paperclip plugin right now and Im getting this error:
ArgumentError in Images#index
Showing app/views/images/index.html.erb where line #19 raised:
syntax error on line 0, col 39...
In one of my templates I want to take a closer look at the controller object using the debug() helper.
It is said to produce YAML suitable for HTML output.
Running <%= debug(controller) %> does, however, not produce anything I call readable.
It begins with:
#<ClubsController:0x104467378 @_request=#<ActionController::Request:0x1044676...
Hi All,
I'm trying to build a form field that can either accept a text entry, or select an option from a dropdown. In rails, the autocomplete plugin is close to what I need, except I want the dropdown to be available before the user types anything in the text field. Is there an example of this out there somewhere?
thx for the help,
-...
So Rails and Merb are sort of merging in Rails 3.0? Thats how its been described to me anyway. This means that a lot of what made Rails, Rails will now be moved to plug-ins so that it can be more lightweight. HOwever, what are those plug-ins going to be and as a new Rails developer, what are THE must have - and also more mature - plug-in...
This is probably a dumb question, but I can't seem to find a good answer. I want to know the best way to refer back to the model that an object belongs to.
For example:
class User < ActiveRecord::Base
has_many :posts
end
class Post < ActiveRecord::Base
belongs_to :users
end
So, to get the user's posts, I can use user.posts, b...
I have a Bill model with nested Customer model.
The Customer model has a phone number with a uniqueness validation on it.
While creating the bill I want to fetch the existing record based on the phone number or create a new one if such doesn't exist.
How should I do it in a RESTful way?
...
Does anyone know how rightmove.co.uk is made? What technologies, databases, programming languages are they using? PHP? Ruby? Python?
I can see that it is using Apache. I would really love to know what database they use.
Thank you in advance ;-)
...
Hey,
I'm having the exact issue as described in this question: http://stackoverflow.com/questions/354194/mysql-installation-troubles. Unfortunately none of the answers helped me (and it's closed).
I try to learn Ruby on Rails and don't get MySQL working (so it is programming related).
I typed: rake db:create and got:
!!!The bundled m...
I'm trying to pass an array into a hidden_field.
The following User has 3 roles [2,4,5]
>> u = User.find_by_login("lesa")
=> #<User id: 5, login: "lesa", email: "[email protected]", crypted_password: "0f2776e68f1054a2678ad69a3b28e35ad9f42078", salt: "f02ef9e00d16f1b9f82dfcc488fdf96bf5aab4a8", created_at: "2009-12-29 15:15:51", upd...
I'm working with a Rails 2.2 project working to update it. I'm replacing existing fixtures with factories (using factory_girl) and have had some issues. The problem is with models that represent tables with lookup data. When I create a Cart with two products that have the same product type, each created product is re-creating the same pr...
Hi guy,
I update my rails application 2.0.2 to 2.3.5. I use active scaffold for the administration part.
I change nothing in my code but a problem is coming with the update.
I have a controller 'admin/user_controller' to manage users.
Here is the code of the controller:
class Admin::UserController < ApplicationController
layou...
Hi,
I've been playing around with rails lately and wanted to go through the deploent process just to see how it worked. I created a simple app with a sIngle model from a scaffold. I uploaded it to my server and found I needed to add /public to the URL to get the 'welcome to rails' screen. However, if I attempted to access my model (pu...