Displaying 20 results from an estimated 300 matches similar to: "Re: Problem with find condition and habtm relationship."
2006 Apr 19
0
Many to many relationship...I think
Hello, I have an issue.
I have a users table (id,name)
Eg. 1, cmircea
Another table called features (id,feature)
Eg. 1,hair colour; 2,eye colour; 3,interests
Another table called attributes (id,feature_id,attribute)
Eg.
1,2,blue; 2,2,green; 3,2,black
3,3,computers; 4,3,music; 5,3,reading
How do I make the connection between users and attributes table?
So basically I want to set for every user
2006 Mar 14
3
Help doing find - look for nonempty habtm
I''ve got a Cuisine and a Restaurant model, with a habtm. One thing I
want to do is find all the cuisines that have at least one restaurant
associated with them. Right now I''m using the following SQL query:
SELECT DISTINCT(cuisines.*) FROM cuisines, restaurants,
cuisines_restaurants WHERE cuisines.id =
cuisines_restaurants.cuisine_id AND restaurants.id =
2006 Jul 31
9
Multiple Pagination
I have the following:
def index
begin
@restaurant_pages, @restaurants = paginate :restaurants,
:order => (params[
:sort ] || "name"),
:per_page => 2
@cuisines = Cuisine.find_all
rescue
redirect_to :action => :index
end
end
# sort by cuisine
def
2006 May 01
0
PostGIS and MySql Spatial Extensions in Rails
Hello,
This post is to announce a new release of the Spatial Adapter for Rails,
which is a plugin that adds support for columns of geometric types (point,
linestring, polygon,etc...) to ActiveRecord. Currently the only supported
databases are MySql and PostGIS.
With this release, geometric columns should behave like columns of any other
basic types in all areas: migration, data access, dumping
2006 Mar 22
1
How do you clean up this cryptic code?
So, I''m coding my school project in Rails.
There are two models, User and Restaurants.
I noticed that in Restaurants, when you use the belongs_to method, you
could specify the condition of the associated table. There are a few
types of users, in the user_type column of the users table - owners is
type 1, users are type 2.
So in my haste to hand in enough code, in the Restaurant model,
2006 May 03
0
Newbie Help
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works
2010 Jan 25
15
database design question: building features
I am trying to decide between two different database architectures for
an application to manage properties. For capturing the property
features, I have two options: a single model/table with all the features
as fields, or a set of joined models - property, feature, feature data.
(see attached ERD diagram)
OPTION A
Properties
name
address
has_pool
has_doorman
has_etc. (a bunch of values, not all
2012 Apr 07
0
RAILS HIGHCHART HEROKU PRODUCTION illegal character
HI am using Highchart on rails on heroku.
View Source of : http://localhost:3000/highchart RAILS_ENV=production
series: [{name: "Restaurants",pointInterval: 86400000,pointStart:
1207526400000,data: [[1325462400000, 4], [1325462400000, 5],
[1325462400000, 3], [1328140800000, 5], [1328140800000, 3], [1328140800000,
4], [1330646400000, 3],
View Source of :
2004 Jul 23
0
AstriCon Update: Very Low Priced Ground Transport Available
-- GOOD NEWS! --
As ground transportation and the costs associated therewith are something of
an issue. So, in the spirit of making AstriCon available I've contacted the
hotel and arranged/discovered some low cost options:
-- MARTA --
MARTA, the Atlanta mass-transit system (i.e. train) can get you there. Take
MARTA from the airport north to the Brookhaven station. The hotel shuttle
will
2008 May 15
1
moving folders bug - rc4
I am fairly new to dovecot...
I had a user who in outlook tried to move one of the folders into
another folder but it crapped out.
User tried to move "Djans*" folders into Koi folder. The subscription
seems to show the folder move but the actual data is still under
".ClickEats.Clients.Djans" instead of ".ClickEats.Clients.Koi.Djans*.
How do I fix this?
Thanks.
root at
2006 Jul 09
1
Quick Question
I have this method in a controller
def sort_by_cuisine
#@restaurants = Restaurant.find(:all, :conditions => ["cuisine_id =
:id", params], :order => params[:sort])
@cuisines = Cuisine.find_all
end
And I want to put the bulk of it in the model, but still call it from
the controller. How can I do this? I''m fairly new to Ruby on Rails and
I''ve tried
2006 May 04
9
Help: wrong number of arguments (0 for 1)
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works fine,
2007 Aug 20
1
Application for Home Delivery Restaurants
Hello All
We have developed an application for Home Delivery Restaurants using
Asterisk, Java (JSP/ JSF) and MySQL. Here is listing of its features. If
someone is interested then we can provide him more details.
- POP up window with caller data containing his/her name, address and
transactions history.
- In case of new customer, Pop up window with blank form to add
customer data and
2013 May 09
0
Replace rows in dataframe based on values in other columns
Hi,
dat1<- read.table(text="
Restaurant owner purchase_date
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Bob??????? 1/1/2013
??????????? 23 Bob??????? 1/1/2013
??????????? 23 Bob???????? 1/1/2013
??????????? 15 Hazel 4/11/2010
??????????? 15 Hazel 4/11/2010
??????????? 15 Hazel 4/11/2010
???????????
2006 Jul 26
0
radio_button groups
For my first rails app, I''m building a web page that will list some
restaurants and then have the user rate them from from 1 to 5 using 5
radio buttons. The view code looks like:
<h3>Ratings:</h3>
<form action="save_ratings" method="post">
<table>
<tr>
<th>Restaurant</th>
<% for rating_option in
2005 Jul 09
2
Modifying astcc
Hi:
Astcc is working fine, except for one thing. It
doesn't give the called party enough time to answer
the phone. If nobody picks up in two rings, astcc
reports back no answer and hangs-up. The only instant
NOANSWER "value" was mentioned in astcc.agi script is:
elsif ($res eq "NOANSWER") {
$res =
&mystreamfile("astcc-noanswer");
2009 May 11
1
Building US maps in R
Hi,
I'm trying to build some maps of the US by county that will have the
following characteristics:
Feature/Map
Map 1
Map2
Both
Broken out by county
Yes
Yes
Yes
Heatmaps of US Census Data for income by county
Yes
No
Yes
Heatmaps of US Census Data for race by county (recoded as white and
&non-white, with each county color coded based on the majority)
No
Yes
No
Polygon
2010 Jul 22
0
Autocomplete - Search Multiple Tables
I''m trying to implement Autocomplete on my site and allow customers to
search for restaurants by name or city all from one search box.
I can''t seem how to get one edit field to interact with Autocomplete
from multiple controllers. I can add the appropriate code into the
controllers to allow access on the page, but how would I modify:
<% text_field_with_auto_complete
2007 Aug 26
0
Nokia cell connectel to asterisk
I use the E-series Nokia phones on my Wireless LAN. The e series have sip agent
On 8/20/07, asterisk-users-request at lists.digium.com
<asterisk-users-request at lists.digium.com> wrote:
> Send asterisk-users mailing list submissions to
> asterisk-users at lists.digium.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
2004 Dec 21
1
Paris Meeting on Dec 20, 2004 - réunion à Paris le 20 décembre 2004
Hi,
Just a quick word on this since I was fortunate enough to attend.
There were about 18 people, almost all French (if you include the
marseillais as French, they may have objections :) Not that I was
counting, but there was one female human there.
Thanks Mark for your generosity and the good choice in restaurants
both this year and last June was it? The souffl? au Grand Marnier was
very nice,