Displaying 20 results from an estimated 1000 matches similar to: "Autocompleter to read value from hidden field"
2006 Jul 24
3
Creating performance test fixtures from development db? How?
Hi all!
I''m looking into the testing chapter of Agile Web Development With Rails
(2nd ed.).
I want to performance test my app, but I''m too lazy to write fixtures for
performance test.
I''d rather use the data from my development db (because the data is so close
to the production data).
How do I get the data into the test db without writing fixtures?
Could you please
2006 Aug 23
11
i18n friendly, plugable Rails Core
In my work with a simple localization plugin, i''m running into a lot of
places in the Rails core, where text and other localization specific
information is hardcoded.
I''ve included some examples in the bottom of this post.
It''s hard for an outsider to know, if the hardcoded values are a result
of inconsistency in code, or "by design". I hope that we can have
2006 May 24
4
AR foreign key problem.
Hello Railslist,
(I''m using RadRails 0.6.3 on Windows XP with Ruby 1.8.4, Rails 1.1 and SQLite3)
I have two tables in the database: "locations" and "customers":
customers.sql
---
id INT PRIMARY KEY
name VARCHAR 255
address VARCHAR 255
postal_code VARCHAR 255
city VARCHAR 255
---
locations.sql
---
id INT PRIMARY KEY
postal_code TEXT
longitude FLOAT
latitude FLOAT
2006 Jun 12
2
Ruby on Rails Copenhagen Meetup
Hi Railers
If you are in the Copenhagen area on the 29th of this month (that''s a
Thursday) Jesper and I would be glad to see you at Caf? Selina in the
central Copenhagen for the first of many Ruby on Rails meetups.
We start at 20:30 hours and have of cause arranged for free beer and
complementary WiFi.
Our goal is to create an inspiring atmosphere where railers (new and
old) can
2006 Apr 11
10
Ruby on Rails as rapid prototyping tool
[This might be slightly off-topic]
I just posted my thoughts on how we use Rails as rapid prototyping tool in
Capgemini.
http://justaddwater.dk/2006/04/12/rails-prototyping/
Unfortunately I cannot give details as to which clients due to privacy
issues. Just want tho share my thoughts on this and hear if you have
anything to add.
--
Jesper R?nn-Jensen
Capgemini Danmark A/S
Oernegaardsvej 16
DK -
2008 Nov 01
2
stuck on a validates_presence_of unless issue
i have a person object. Persons don''t need to have addresses, but if
they have any address field value, they must have them all. So I have
something like this:
validates_presence_of :street_address, :city, :state, :postal_code
unless :address_blank?
address_blank? checks whether all of the address fields are blank.
If I run a test like this, it works:
describe "given
2012 Aug 17
3
Rails doesn't validate create_model or build_model (has_one association)
I''ve got User has_one Shop. Rails is not validating when I tried
create_shop or build_shop, neither in the browser nor the rails console.
My code:
class Shop < ActiveRecord::Base
attr_protected :user_id
belongs_to :user
validates_presence_of :name, :primary_address, :city, :country_code,
:currency
end
class ShopsController < ApplicationController
before_filter
2006 Mar 29
2
delete_all not resetting auto incement in database
Hey
I''m writing a simple admin interface thats reading user data (skills)
from a comma separated file.
To clear the database before inserting new skills, I use
Skill.delete_all
Then I insert the new values I read from a file. Everything goes well
up to the point where I see that auto-generated ID''s are not starting
from 1. They start off at 840 (responding to the number of
2012 May 04
3
Database schema question
Im setting up a very basic rails app and have a question about the needed
migrations & associations.
Basically, my app is an occasion reminder service that emails users when
occasions that they select or input are coming up.
Occasions will be selected from a checkbox type list or alternatively
manually input by the user (name and date of the occasion).
Users can have_many occassions.
2006 Apr 23
2
Rails Recipes
Rails Recipes ... has got some very appetizing recipes. However, I have
a hard time starting. For example, the very first recipe,
InPlaceEditing, how and where do I run this code to create the table?
Thanks!
class AddContactsTable < ActiveRecord::Migration
def self.up
create_table :contacts do |t|
t.column :name, :string
t.column :email, :string
t.column :phone,
2006 Oct 11
1
Polymorphic Validations
Hi Everyone,
Ran into an interesting case last night, and I was hoping that someone
on the list here could give me some guidance.
I''ve got a Polymorphic association for Addresses (which can belong to
two different models).
The catch is, one model requires a strict, precise address, and the
other only requires a City, State and Postal Code.
I want to use :validates_presence_of :street,
2007 Sep 18
0
distance_of_time_in_words hardcoded strings should be separated for easier localization
Hi everybody.
After DHHs talk at RailsConf yesterday, it''s essential that some of
you can rectify this patch for ruby on Rails
Please help me an have a look at
http://dev.rubyonrails.org/ticket/9587
Thanks!
Jesper Rønn-Jensen
blog: www.justaddwater.dk
=====
ActiveRecord::Errors has a placeholder (@@default_error_messages) for
messages that can be overridden.
Just the same way, the
2007 Dec 09
0
Windows, Rails2.0, Zlib::BufError or Mongrel crash with rubygems update --system
(this will be a bit off topic, but in my opinion important info for
Windows users)
Hope i get your attention before running "gem update --system" on
win32, as the 0.9.5 version of rubygems caused me some problems
I have done what I could to gather the information and write what
worked for me:
Rails 2.0, gem install, Windows => Mongrel Trouble
2008 Jul 06
1
GeoKit / Form Validation
I am new to rails and have been scouring the web for the past two days
trying to figure out 2 things.
1) I am currently using a form with 2 models. The first is person, the
second is address. I attempted to duplicate the two models on one form
as seen in Advanced Rails Recipes and Railscasts, and they work fine -
except when there are validation issues on the address piece it just
returns saying
2008 Mar 19
2
Stub / Mock - A little guidance?
Hi there,
I''m still trying to wrap my head around when to use a stub and a mock.
If I understand this right, I should be using a ''mock'' when imitating
an object, but not its behavior. I should be using a stub when I want
to imitate the behavior of an object. Does that sound about right?
With that said, I''m struggling a little trying to spec out this
instance
2006 Feb 24
1
Autocompleter Problems
Hi,
I''m trying to get autocomplete to work but have been having some problems.
It seems that Ajax.Autocompleter(...) is not getting called. I''ve put in a
alert in control.js:
Autocompleter.Local = Class.create();
Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
initialize: function(element, update, array, options) {
window.alert("GOT
2007 May 04
2
Custom Matcher and NAME NOT GENERATED annoyance
Hello RSpec users,
Have been using RSpec since 0.8.2 (not too long ago, I must say). and
been creating my custom matchers since was defined as "good practice".
Also, auto-generated names for the examples is very helpful, I''m
trying to take advantage of it.
Since I often prior code/define all the "examples", I have created a
few matchers to fulfill associations and
2009 Apr 16
0
how to convert the find_by_sql code to the find code
I want to convert following query into pure ruby one i.e. by using find
@us_state_sales=SalesReport.find_by_sql("SELECT z.state,
sum(s.royalty_price) as royalty_price, sum(s.units) as units FROM
sales_reports s, zip_codes z
WHERE royalty_currency = ''USD'' && z.zip_code=s.postal_code GROUP BY
z.state ORDER BY royalty_price desc LIMIT 10")
i try something like
2006 Mar 02
2
Ajax.Autocompleter with an empty field
Hey guys,
I have a field that will have very few autocomplete options. I have
an ajax.autocompleter on it that works great, but I wanted to make it
start autocompleting as soon as the field is blur()ed, so that even
if the field is empty, the list will still appear. Like a combo box
in windows. How can I do this? Setting :min_chars => 0 (or even -1)
didn''t work...
-Josh
2006 Feb 13
2
Ajax.Autocompleter is not a constructor
Hi Rails,
I am having trouble setting up an autocomplete text field. Using rails 1.0.0
and just trying to copy the simple scriptaculous demo
(http://demo.script.aculo.us/ajax/autocompleter) fails. My view and controller
are set up the same way.
In firefox 1.0.4 (and safari, don''t remember the version) I get the
Ajax.Autocompleter error in the javascript console when loading the