Lets say I do not want to get the VPS or Dedicated Server required to run constant indexing like with Thinking_Sphinx plugin or many of the other full text search plugins for ruby on rails.
I have a bunch of listings in the database with a Name field and category field (among other things).
It it possible search for a name in a certain...
I have a remote_form which works 100%
When a user clicks submit, it goes out grabs so data from the db or data scraped from another website, and updates the page seamlessly...
The problem I'm having now, is that I'd like to do the same thing, but do it without having the user click the submit button with an onload event. I think I'm ...
Hey guys,
I'm new to Ruby and I've been playing around with making some webapps with it and I find it totally awesome. I just recently configured Authlogic to perform authentication within my app and next I would like to create a table that stores user profile information such as address, zip, phone, etc. and then later display some of...
Hi,
I've downloaded the questions_answers_foo plugin and placed it at vendor->plugins folder, as I usually do. Then, following its documentation, I ran rake question_answers:install and I get this in the output:
ArgumentError: wrong # of arguments(0
for 1)
I followed the installation steps but I get this error. Does anybody kno...
This might be a really basic question but how do I create default values in forms?
I'm trying to put the <%= params[:id] %> of the page in as a default hidden value in this form.
`<% form_for(@revision) do |f| %>
<%= f.error_messages %>
<%= f.label :background_title %><br />
<%= f.text_field :background_title %><%= params[:id] %>
<...
named_scope :incomplete?, lambda { |user_id, todo_id|
{ :select => 1, :conditions =>
[ "#{user_id} not in (select user_todos.user_id from user_todos) and
#{todo_id} not in (select user_todos.todo_id from user_todos)" ]
}
}
I'm getting a nil result. I want it to return true. What I gotta do!?
Also, is there a better w...
I've got my Rails application on Mac OS X and it's ready for IE compatibility testing. I've tried running the server and booting up VMware and pulling up the localhost:3000 with no luck.
How can I test my Rails application on IE6-8 and Chrome without deploying it somewhere?
...
I need to duplicate a record, with the same attributes of the original except ID of cource. I do:
In the View:
<%= link_to "Duplicate", :action => "clone", :id => Some_Existing_ID %>
And in the Controller:
def clone
@item = Item.find(params[:id]).clone
if @item.save
flash[:notice] = 'Item was successfully cloned.'
else
...
Hi,
I am a new with ruby.
I am trying to run rake test from the application root and I get loaderror, no such file to load from the rake test loader : 5, i.e. it is not able to locate or load the test files.
I created a new app to see if this behaviour is app. related, but it still doesn't work.
Where should I look? Is this related ...
There is a substantial MySQL database with data weighting hundreds of gigabytes. It experiences performance problems. Vertical and horizontal partitioning of tables are possible roads to increase performance.
In your opinion would splitting this database into several databases be beneficial to increase performance as well?
The project ...
I have an ActionController derived Test which sends a 'post' request to the controller under test with incorrect data. The controller tries to create a new object and save it. The model has validation methods that get triggered on save and they generate a validation error detecting the incorrect data sent by test.
So far so good. Now, c...
I have a model, Report, that is polymorphic.
So many itens in my site may have many of it.
And i would like to have a generic controller for posting it.
Its a very simple model, has only a text message and the association.
in my routes, im doing something like
map.resources :users, :has_many => [ :reports ]
map.resources :posts, :has_...
As a Rails developer I feel a bit stupid asking this question but hopefully I will learn something new and someone can put me out of my misery! In my rails applications I use (other peoples) gems all the time, I also use plugins from the community or my own.
I understand the benefits of use gems over plugins as they are version-able, se...
Hi everybody,
I've got a very strange message error. I think it's not coming from Ruby but from the unix system.
So, I have the following test file:
require File.dirname(__FILE__) + '/../test_helper'
class CatTest < ActiveSupport::TestCase
def test_truth
assert true
end
end
So, nothing coming from YAML files in the Fixt...
I'd like to have my password_fields styled the same as the Blueprint framework's default style for input fields. What do I need to put in my .sass for this?
...
Should I use:
Community Engine
Insoshi
LovdByLess
RailsSpace
Roll-my-own
I am looking to quickly get a social network up with support for mobile browsing. While I'm familiar with Ruby & Rails, I am not an expert (have built some basic Rails apps, have written a bunch of Ruby programs for enterprise integration).
Thanks, skybison
...
I'm developing a Rails app that by default sets up user accounts to a subdomain of their choosing. As an option, they will be able to map their own full domain to their account.
So far this is how I have things set up. I am using subdomain-fu to power the routing:
# routes.rb
map.with_options :conditions => {:subdomain => true} do |app...
I am developing a card game server, for a game where each player has a deck and a discard pile. To reflect the fact that a given card could be located in a player's deck or their discard pile, I have my Player model set up as follows:
class Player < ActiveRecord::Base
belongs_to :game
has_many :deck_cards, :class_name => "Card",
...
In my model "Post.rb", I'm trying to have it only return posts if column deleted is 0. In other words, when the user deletes posts, it doesn't remove the item from the database, but rather turns deleted to 1. So if I run Post.find(:all), I want it to automatically add the condition "deleted = '0'". How do I go about doing this from my...
In my Post.rb model, I have default_scope :conditions => {:deleted => 'false'}
But if I try to run Post.find(:all, :conditions => "deleted='false'"), it won't return anything. It's as if the default_scope takes precedence over everything.
I want it so that when I do Post.find() it doesn't return deleted posts, but I'd also like to b...