similar to: Build associated model confusion

Displaying 20 results from an estimated 3000 matches similar to: "Build associated model confusion"

2010 Jul 19
1
geokit app
Newbie here :) So, a friend mentioned that geokit is the way to go if I want to make a simple location based app. I basically want to make a list of locations so the app should allow me to Create a location, give it a name and an address along with the geo location information associated with it. (Geokit will take care of this last thing right?) I tried looking for sample apps but had no
2009 May 04
6
cucumber - when to stub/mock
I''m just curious about this, since my solution involved stubbing a call to GeoIp. Is there a good rule of thumb for when you make exceptions to the ''no stubbing'' philosophy of Cucumber? My step was: "Given I am accessing the site from Japan," but I can think of other situations - mostly when interacting with web services, that I''d probably
2006 Jun 29
11
AJAX Maps
Hi, I would like to know if there is a library that provides an API to support map scrolling, like the one available in google maps. This is, I would like to create a user interface where the user is able to see a small part of a large map. It can then move the view, thus observing another part of the map. Additionally, I would also like to provide a zoom mechanism. Thanks in advance. --
2009 Feb 23
2
geokit - using :through to connect models
hello.. i am currently trying to use :through to attach two of my models together using geokit. for some reason, i am running into a problem: ArgumentError: Unknown key(s): as i have two models, one that is geocoded, and one that belongs to that model. the models look like: ,----[ employer.rb ] | class Employer < ActiveRecord::Base | acts_as_mappable | before_validation_on_create
2011 Sep 19
14
gmaps4rails "acts_as_gmappable" error
Hi all, I started to see fun of gmaps4rails gem from https://github.com/apneadiving/Google-Maps-for-Rails. After everything done. When visited the locahost, i got the following error. undefined local variable or method `acts_as_gmappable'' for #<Class: 0x31a9da8> the error is due to i have line "acts_as_gmappable" in my model. Anybody knows how this is
2008 Jan 23
3
Find city, state from supplied ZIP Code
Is there a simple solution available that would allow me to take a ZIP Code from a user and then populate City and State fields based on that ZIP? Any kind of a plugin, for example? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Nov 09
3
help getting started with javascript generated forms
How does one generate a form within a view using javascript? Specifically, assume views/premise/new.html.erb looks like this: <%= form_for(Premise.new) do |f| %> <%= f.hidden_field :full_address, :value => $FULL_ADDRESS %> <%= f.hidden_field :geocoding, :value => $GEOCODING %> <%= f.submit :value => "use this address" %> <%= f.label
2011 Mar 18
3
webapplications with rails+geokit
Hi all Anybody knows any webapplictions presently using geokit plugin with rails 2.x or 3.x ? If yes pls send me the url pls. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2009 Sep 20
3
coordinates for geokit
i''m trying geokit and loving it, but i''m seeing really odd stuff on distances, I''m wondering about the coordinates i''ve got in my DB. I don''t think they''re standard format, they look like this. east 6''41.6 north 45''24.8 Can anyone advise please ? -- Posted via http://www.ruby-forum.com/.
2009 Jan 09
2
Ruby & Javascript
Hey guys! Does anyone knows how to a ruby program communicate with the Google API, which one is written in Javascript ? I''ve heard something about a wrapper to do the communication, but i didn''t find anything yet. I know a plugin for rails can do that (geokit), but i don''t know how. There is a method (geocode) that use the javascript function to return the XML data
2006 Jun 26
2
How can I sort options in a select box?
Pretty much a newbie here, looking for help on select boxes in forms.... Is there any way in the view to sort the options of a drop-down select box? My current code (within a larger _form.rhtml file) is: <div class="form-element"> <label for="asset_location_id">Location</label> <%= select ''asset'', ''location_id'',
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
2011 Mar 18
1
using Geokit with rails3
HI all i am a newbie ,and starting a rails 3 application and my application needs geokit plugin .so anybody knows how to install geokit plugin in rails 3 and using it with the application? I am using ruby 1.9.2 and rails 3.0.3 with mysql2. pls help.. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary relationship table to handle my many-to-one relationships. Here is an example of what I''ve written down. For instance say I want to find all of the people in a given location. class Location < AR:Base has_many :people end class Person < AR:Base belongs_to :location end My SQL tables look like: CREATE TABLE
2006 Mar 16
4
Table Relationships Problems.
I have the following tables setup: locations :id :name systemmessages :id :name systemmessage_validtimes :id :name :systemmessage_id :location_id :start :end The systemmessage_validtimes has a ''has_many'' relationship with systemmessages, meaning that there could be many valid times for each system message. @systemMessage = Systemmessage.find(1) E.g. I
2006 Jun 07
10
habtm "AND" find conditions
I have two tables and a join table for them e.g. books, authors in a many to many relationship (habtm) and a join table books_authors. I can successfully search for a book that has "author.id = 2 OR author.id = 4" but I am unable to search for "author.id = 2 AND author.id = 4" This is because the result of all the joins only has one author.id column so no single row has
2006 Dec 29
3
Functional test a "create" action when a validation fails
I''m trying to write a functional test of a "create" action in one of my controllers. In the corresponding model I have a "validates_uniqueness_of :location". In the test case I am constructing I have the create fail with the error "Location has already been taken". Is there a way I can write an assertion like: assert_equal "Location has already been
2006 Jul 07
4
How to add Asia token analyzer to ferret simply?
Hi,David Can you give me an example of how to add analyzer to ferret to Asian languages? My web application will have to support multi language search,which means,for example,both Chinese and English will be searched through the form. Currently,I have decided to use the simple token principles,which means that every Chinese character will be a token,although this is not so well in some
2008 Apr 23
1
Validation dependent on unsaved parent
I''m having trouble with a validation that depends on an attribute of a belongs_to parent. If the child is added to an unsaved parent (parent.children << new child), the has_many collection parent.children includes the unsaved child. However the belongs_to attribute child.parent appears to be nil until the parent has been saved. Without access to the parent attributes, the validation
2008 Feb 07
1
geokit on merb
I converted the rails geokit plugin to a merb plugin today. Anyone interested in testing it out? It seems to be working great for me. If so, where should I put it? I don''t have a blog up or anything right now. Been meaning to do that, but haven''t had the time. -Dusty Doris