Displaying 6 results from an estimated 6 matches for "location_typ".
Did you mean:
location_type
2008 Jun 12
1
unidirectional belongs_to polymorphic
...ecifically, the headache involved with the many-to-many and the
caching and everything isn''t worth the cost. I just want to be able
to store a location for a Person (and for various other models that
are unrelated to Person).
Some questions:
Why does Person need both a location_id and a location_type? In order
to instantiate the location, it needs to look up the whole row in the
locations table, which includes a "type" column (as required by single
table inheritance).
Why won''t the new sexy fixtures work on this (regardless of whether
Person has a location_type column)? T...
2011 Sep 27
0
has_many with :finder_sql returns [nil]?
Is it supposed to do that? I find it very confusing.
AR 3.0.10
class Unit
has_many :units, :finder_sql => proc {
"SELECT * FROM `#{table_name}` WHERE `location_id`=#{id} AND
`location_type`=#{Location::UNIT}" }
end
Both should return []. However...
>> Unit.first.units.find([1000000])
[2011-09-27 10:05:11|main|debug] Unit Load (4.0ms) SELECT `units`.*
FROM `units` LIMIT 1
[2011-09-27 10:05:11|main|debug] Unit Load (3.0ms) SELECT * FROM
`units` WHERE `location_id`=1...
2008 Nov 05
4
select in form - best practice?
Q. What resource do readers recommend for referencing regarding best
practices for form construction in Rails?
I have the following situation: location_type of Locations may have one
of five (5) possible codes. Presently I have these codes listed in a
drop-down select constructed thusly:
<p>
<b>Location type</b><br />
<%= f.select :location_type,
[
[''MAIN - Main Address'', ...
2006 Feb 09
0
pass values with autocomplete textfield
...filter the
autocomplete results by the value of the select.
My view code looks like this:
<%= form_remote_tag :update => "search_results",
:url => { :action => :search } %>
Location: <%= text_field_with_auto_complete :location, :name %>
<%= select :loc, :type, @location_types.map { |l| [l.location_type] } %>
<%= submit_tag "Search", :class => "search_btn" %>
<%= end_form_tag %>
Is this possible?
Thanks,
Chris
2014 Feb 06
0
Array Confusion
...t;"94043", "types"=>["postal_code"]}], "formatted_address"=>"1600 Amphitheatre Parkway, Mountain View, CA 94043, USA", "geometry"=>{"location"=>{"lat"=>37.4219985, "lng"=>-122.0839544}, "location_type"=>"ROOFTOP", "viewport"=>{"northeast"=>{"lat"=>37.4233474802915, "lng"=>-122.0826054197085}, "southwest"=>{"lat"=>37.4206495197085, "lng"=>-122.0853033802915}}}, "types"=>[&quo...
2007 Nov 07
5
Unexplainable failure...at least for me
.....
end
When I run this in the console it works fine
>> a = Address.new
=> #<Address:0x24c6420 @new_record=true, @attributes={"city"=>nil,
"latitude"=>nil, "region_code"=>nil, "province_id"=>nil,
"country_id"=>nil, "location_type"=>nil, "location_id"=>nil,
"address_1"=>nil, "address_2"=>nil, "longitude"=>nil, "address_3"=>nil,
"address_4"=>nil}>
>> a.country_id = 1
=> 1
>> a.country.name
=> "Canada"
>>...