Every-time I create or update a model in my Rails app, the following output occurs from Sphinx:
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew
Aksyonoff
using config file
'/Users/jason/development/projects/active/project/config/development.sphinx.conf'...
indexing index 'ad_delta'... collected
17 docs, ...
I can't seem to find the answer to this,
I somewhat see what it does through implementation, but don't grok the sense of it..
...
So I'm using this plugin: jquery-in-place-editor, I'm trying to make a POST request according to the docs, but I'm not sure what URL to do the POST to, I can't seem to get it right.
If I'm in the show view for the object, which in this case the path is: /quote_line_items/90
But when the script executes I get this error: No action respo...
Imagine you have two defined routes:
map.resources articles
map.resources categories, :has_many => :articles
both accessible by helpers/paths
articles_path # /articles
category_articles_path(1) # /category/1/articles
if you visit /articles, index action from ArticlesController is executed.
if you visit /category/1/articles, index ...
Here is the error I'm getting. It just started out of the blue
undefined method `changes' for #<SQLite3::Driver::FFI::Driver:0xa75235c>
I'm using
ruby 1.9.1p243
gem 1.3.5
rails 2.3.5
ffi 0.5.4
sqlite3 0.0.3
On ubuntu 9.10 desktop, but i've had the same problem 9.04
Anyone know what's causing this error?
...
Hi
I am trying to use hpricot in a controller. I would like to pass this value to a html.erb page so I can display it on the screen
So I wrote this:
session[:allcars] = (doc/"td.car_title/text()")
but this gives an error
when I tried this:
puts (doc/"td.car_title/text()")
this printed the cars into the console.
So I can't under...
I have been reading a lot about Ruby the past few days. Every SO post I come across I hear that ruby is an elegant language. Can you guys give an example of why ruby is elegant compared another language?
...
I'm not sure if what I'm even trying to do is possible but here goes.
I have an SQL database with the following tables defined (showing only relevant tables in SQL):
CREATE TABLE customers(
id integer NOT NULL UNIQUE,
name vachar(25) NOT NULL,
surname vachar(25) NOT NULL,
password vachar(20) NOT NULL,
email_address ...
I want:
Every projectpart to belong to a
project.
Every solution to belong to a
projectart (and to a project through
that projectpart).
Every image to belong to a solution
(and to a project and a projectpart
through that solution.)
Every document to belong to a
solution (and to a project and a
projectpart through that solution.)
Every ...
I have the following filter defined:
# application_controller.rb
class ApplicationController < ActionController::Base
before_filter :find_account
private
def find_account
@current_account = Account.find_by_subdomain!(request.subdomains.first)
end
end
and in my test:
# users_controller_test.rb
class UsersController...
My understanding of the has_many relationship in Rails is that it will use a JOIN to find related rows. If I were implementing this from scratch I would have created a relational table. Am I correct in thinking it will be slower to use a JOIN? In Django, I believe the relational tables are created, and I know that I can use a relational ...
I'm setting up a rails app with simple page caching. (First time I've tried using page caching.)
The cached pages are being created. I have my cache folder set to /public/cache. The cached pages are automatically being created according to their URL, which follows the published date (to avoid filename collisions). I don't have any custo...
I'm building an app that integrates with Highrise, and so-far-so-good, however, when trying to import a person Highrise::People it spits out a huge hash similar to this:
[ ..., #<Highrise::Person:0x1035084b8 @attributes={"contact_data"=>#<Highrise::Person::ContactData:0x1034f8b30 @attributes={"email_addresses"=>[], "addresses"=>[], "we...
I'm having an issue with Passenger and Rails working together on my Scalr application server.
I have Rails 2.3.5 installed and Passenger 2.2.7. I am running ruby 1.8.6 (patchlevel 111). Previous version of both Rails and Passenger worked fine together but now I get shown just a file tree and no application after updating:
http://matchm...
I'm creating a few gems by extracting out parts of a Rails project that can be reused (and that I have duplicated in other Rails projects). The problem I have is that testing every change to the gems is now very slow.
Changing a Rails project is very fast as most of the time the change is re-loaded automatically, but changing a gem impl...
I'm not sure how to accomplish overloading the << operator for a method. This is how I assumed it would work:
def roles<<(roles)
...
end
That however, throws errors. Any suggestions?
...
Are there any resources or documentation for developing Rails plugins?
I'm using other plugins as examples, but it's hard to know if I'm doing something wrong, or if there's another way to do something. All I can find are old blog posts. I haven't found any documentation on how to develop plugins and what functionality/hooks are availabl...
This makes debugging incredibly difficult.
For example:
Nov 25 14:32:34 Joseph-Rodriguezs-MacBook rails[5167]: NoMethodError (You have a nil object when you didn't expect it!You might have expected an instance of Array.The error occurred while evaluating nil.replace): app/models/service_item.rb:560:in `send_proposal_email' app/model...
I have a requirement to be able to identify a record in a table, in this case a user table, by a unique key which does not give away the ordering of the records in the table.
Currently I have primary key field and the routes that are generated look like:
/users/1
However, I'd like to be able to generate a route like:
/users/kfjslncd...
Does anybody know how to update RubyGems on Ubuntu. The usual way doesn't work:
steve@ubuntu:~$ rails /home/steve/www/mynewapp -d mysql
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
...