Displaying 20 results from an estimated 700 matches similar to: "Newbie Help"
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,
2006 Dec 28
1
Default Scaffolding Gives Errors
This is the default scaffolding for list.rhtml:
[code]
<h1>Listing <%= @scaffold_plural_name %></h1>
<table>
<tr>
<% for column in @scaffold_class.content_columns %>
<th><%= column.human_name %></th>
<% end %>
</tr>
<% for entry in instance_variable_get("@#{@scaffold_plural_name}") %>
<tr>
<% for
2006 Feb 16
6
http://127.0.0.1:3000/
Hi,
I installed ruby on rail on my windows system.
I sucessfully made one database related application.
But when i want to execute it, i have to give url like
http://127.0.0.1:3000/wedding/ etc.
can''t i browse through my browser?
192.168.0.51 is my ip.
Another one thing is i never get file named new in my example then also
it executes file called new for database inserting ,how it is?
2006 May 06
0
RE: Rails Digest, Vol 20, Issue 156
I am looking for a ruby hosting service. Can any one recommend one for me.
-----Original Message-----
From: rails-request@lists.rubyonrails.org [mailto:rails-request@lists.rubyonrails.org]
Sent: Saturday, May 06, 2006 7:37 AM
To: rails@lists.rubyonrails.org
Subject: Rails Digest, Vol 20, Issue 156
Send Rails mailing list submissions to
rails@lists.rubyonrails.org
To subscribe or
2006 Aug 13
5
Newbie question: scaffold not working
I went through a tutorial at
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1 to get
started with RoR. I really like the idea of the scaffold construct, but
I can''t seem to get it to work the way it was described in the tutorial.
I''ve got a mysql database that is properly configured, and a table
called ''quotes'' with a column called
2006 Feb 03
1
modifying scaffold method
I''ve made the following changes to scaffolding.rb. Is it possible to
put those changes into some type of a plugin or helper or something,
instead of directly modifying the Rails source?
(and, btw, I think pagination should be removed from scaffolding. And
deletes should only happen on post requests. That''s essentially what
I''ve changed).
Thanks,
Joe
Index:
2006 Aug 22
0
Re: Problem with find condition and habtm relationship.
OK. This may help, but it will also make your head hurt. The basic
problem that you''re running into is that you want a "for all"
operator and sql doesn''t have one. Instead, you have to think of the
query in terms of the logically equivalent "not exists not".
Effectively, a proposition is true for all x if you can''t find a
counter-example in
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 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 Feb 23
3
has_many reference
I am trying to do something right from Agile Web Dev with Rails book
and it does not work. I must be missing something obvious.
I have a one-to-many relationship:
class Draft < ActiveRecord::Base
has_many :endorsees
end
class Endorsees < ActiveRecord:: Base
belongs_to :draft
end
>From my reading, methinks I should be able to say:
d = Draft.new
d.endorsees << Endorsee.new
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 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 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 Mar 03
7
Another question about the tutorial
Hello
After upgrading to ruby 1.8.2, finally got rails to install properly.
Now, following the tutorial, I found a couple of things:
First, apparently rails tries to establish local mysql connections using
"/tmp/mysql.sock"
which mandrake does not use. In mandrake 10.1, this file is located at
"/var/lib/mysql/mysql.sock".
The solution is to create a simlink
2020 May 30
3
Cargar archivo .RData desde OneDrive, Google Drive o Dropbox
Hola, gracias por la respuesta.
Yo también puedo descargar el fichero pero no lo carga de forma correcta:
> drive_download("
https://drive.google.com/file/d/1iN7rT-W8WoXsdBpKzxcatFx7nGPWNkuz/view?usp=sharing
",
+ overwrite = TRUE, verbose = TRUE)
File downloaded:
* restaurant.RData
Saved locally as:
* restaurant.RData
> restaurant <-
2011 Oct 23
2
[LLVMdev] Adding sub-commands and option classes to the command line library.
There was discussion on IRC about merging all of the compiler hacker
tools (llvm-as, bugpoint, llc, lli, etc...) into a single llvm
megatool. This tool would work similar to how most version control cli
programs work. One would call 'llvm as bitcode.ll' instead of 'llvm-as
bitcode.ll'. The main reason for this is to improve link time, but it
also reduces the total file size
2020 May 30
3
Cargar archivo .RData desde OneDrive, Google Drive o Dropbox
Hola a todos, espero que todo esté marchando bien.
Estoy intentando cargar un archivo con extensión .RData desde OneDrive,
Google Drive o Dropbox.
Con OneDrive he intentado lo siguiente:
temp <- tempfile()
download.file("
https://alumnosuatedu-my.sharepoint.com/:u:/g/personal/rivaldez_uat_edu_mx/ESNKsBZE5rhMp4_shdbavXEBz4mUuIaeKWIXlMMlpyqyUA?e=NfZupt
",
temp, method =
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
2005 Dec 16
3
Adding methods to models
All,
This is more of a theoretical question I suppose - I''m looking for what the
consensus is for the "correct" approach in Rails/MVC.
I have a standard security model where a User can have many Roles. There is
a User model, a Role model, and in the db, a linking table, etc. Each role
has a name as well as a category (say, name="waiter", category="restaurant