I'm using RoR + acts_as_solr to query a Solr database.
I'm used to using "*" to select all, thanks to MySQL, but that command fires an exception in Solr. Are they other wildcards I can use? Suggestions? Thanks!
...
It's been a while since I've last used backgrounding in Rails. I've use backgroundrb and bj before. Is there anything else that manages background tasks better?
...
I am by no means a Ruby developer, but I code HAML for a ruby framework on my localhost.
I had originally put a file called vidgirlBox2.flv file and called to it within the HAML, but converted the file to a swf called vidGirl_home.swf .
This swf worked.
Until I made a simple change to the orginal .fla, and overwrote the vidGirl_home...
Hi folks,
When creating a record in a unit test, I'm getting an 'ActiveRecord::RecordInvalid' when it's run with rake test:units. I don't get this error when I run the unit test manually with ruby ('ruby unit/blah_test.rb'). I've narrowed the issue down to a validation that exists in my model. It is an inclusion validation which is a...
This one has me stumped, so I'm hoping someone who's smarter than me can help me out.
I'm working on a rails project in which I've got a User model which has an association of clock_periods joined to it, having the following partial definition:
User
has_many :clock_periods
#clock_periods has the following properties:
#clock_i...
I am trying to use a time_select to input a time into a model that will then perform some calculations.
the time_select helper prepares the params that is return so that it can be used in a multi-parameter assignment to an Active Record object.
Something like the following
Parameters: {"commit"=>"Calculate", "authenticity_token"=>"e...
How can I roll my own counter cache for a self-referential many-to-many relationship that uses has_many :through?
I need to track the number of citations and references for each article
I'm using roughly the code from the answer to this question:
class Publication < ActiveRecord::Base
has_many :citations
has_many :cited_publicatio...
how do i add onchange event here?
Framework: rails
Database: MySQL
am populating the options from the database and tat made me to use options_from_collection_for_select
select_tag(:variable,options_from_collection_for_select(:all, :id, :name))
thanks in advance.
...
When I try to run InstantRails 2.0 under Vista, which I've extracted to C:\InstantRails, I get the following error:
Either Apache or MySQL cannot run because another program is using its port.
What do I do here? MySQL server is installed fine.
...
I'm writing my own file upload in rails. I saw some related questions but it doesn't answer my question. I use
File.open ("#{RAILS_ROOT}/public/docs/attachments/#{@file_name}", "wb") {|f| f.write(@temp_file.read)}
to write the file on my local machine (OS: Windows XP) instead of saving it in database. I got a Permission denied error o...
Hi,
I use Qcodo/Qcubed in PHP as PHP5 framework. I am interested in Ruby on Rails, but as my first RoR web app I have to use an existing database (web app with PHP4). I know that RoR is a DSL and everything can be created from your defined doamin, but is it possible to do the reverse engineering?
I just need, to start, to generate a ba...
I'm sure this is simple but I can't seem to get it:
Works:
@build1 = Booking.build_booking('2009-06-13',3,2,18314)
@build2 = Booking.build_booking('2009-06-13',3,4,18317)
@build = @build1 + @build2
What I want to work...
#for item in @cart.items do
# @build << Booking.build_booking('2009-06-13',3,2,18314)
#end
Doesn't work either...
How can I write an AR find query to have the results ordered by the number of records in a has_many association?
class User < ActiveRecord::Base
has_many :photos
end
I want to do something like...
User.find(:all, :order => photos.count)
I realize my find is not valid code. Say I have the following data.
User 1, which has 3 phot...
My Lucene/Solr database contains a date column (created_at) that I need to use as a condition in a query.
I'm new to RoR and assume that RoR automatically uses its own date object upon anyObject.save, and that Solr in turn reindexes that column in its own way.
Regardless, the date is in this format: "2008-06-03 11:15:20"
I can write ...
Hi all,
I've been trying to get RSpec running under Ruby 1.9, and my tests just aren't running. Here's my trace:
matt@matt-desktop:~/Development/my_app$ sudo rake spec --trace
(in /home/matt/Development/my_app)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** I...
I am trying to figure out a 'proper' way of sorting UTF-8 strings in Ruby on Rails.
In my application, I have a select box that is populated with countries. As my application is localized, each existing locale has a countries.yml file that relates a country's id to the localized name for that country. I can't sort the strings manually i...
Hi All,
YayMyLife.com is my first Rails site. I am using Apache/2.2.8 (Ubuntu) Phusion_Passenger/2.2.2 .
The site works fine on Linux/Mac/Phones. However, it does not load on any browser on XP. This behavior is also found on other XP machines. The browser seems to wait for more content and it times out. I have checked headers with Liv...
I'm trying to define multiple polymorphic relations (has_many_polymorphs plugin) from a single parent to same children.
Note has many viewers
Note has many editors
Viewers could be either Users or Groups
Editors could be either Users or Groups
Permission is the association model with note_id, viewer_id, viewer_type, editor_id, editor_ty...
I have a Rails app that needs to send SMS messages to users but does not need to receive messages.
Is there a free way to do this programmatically? If so, how free is it - do they charge if you go over a certain number of messages?
I know Gmail allows you to send SMS messages now. But I'm not sure if this means you could also send an S...
I have a mystifying problem. In a very simple Ruby app i have three classes: Drivers, Jobs and Vehicles. All three classes only consist of Id and Name. All three classes have the same #index and #show methods and only render in JSON or XML (this is in fact true for all their CRUD methods, they are identical in everything but name). There...