yaa...but this line throws no error
config.nested.add_link(:procedureexecutions, :label = Run, :inline
= false)
Colin Law wrote in post #1070901:
On 1 August 2012 12:02, deal bitte li...@ruby-forum.com wrote:
wrong number of arguments (3 for 2) I am getting this error for the
following
That's two params: Symbol (:procedureexecutions), followed by a hash (which
omits {}): :label = Run, :inline
= false )
So that's fine.
2012/8/1 deal bitte li...@ruby-forum.com
yaa...but this line throws no error
config.nested.add_link(:procedureexecutions, :label = Run, :inline
= false)
Kurtis Rainbolt-greene wrote in post #1015633:
Try this:
https://gist.github.com/1133491
On Mon, Aug 8, 2011 at 10:36 PM, praveen k. li...@ruby-forum.com
wrote:
wrong number of arguments (2 for 0..1)
To unsubscribe from this group, send email to
John Merlino wrote in post #964838:
Hey all,
I did a script/generate controler users in console.
Then I added the following to users controller:
class UsersController ApplicationController
def initialize(first_name, last_name)
@first_name = first_name
@last_name = last_name
You are right. It worked. Nevertheless, the behavior was the same. We
instantiated an object and called a constructor method of the class.
Both User and UsersController are classes. I don't know what is causing
the behavior to be different. Are there any good books on MVC design
patterns? I
On Nov 29, 7:34 pm, John Merlino li...@ruby-forum.com wrote:
You are right. It worked. Nevertheless, the behavior was the same. We
instantiated an object and called a constructor method of the class.
Both User and UsersController are classes. I don't know what is causing
the behavior to be
John Merlino wrote in post #964846:
You are right. It worked. Nevertheless, the behavior was the same. We
instantiated an object and called a constructor method of the class.
Both User and UsersController are classes. I don't know what is causing
the behavior to be different.
Gee, do you
Hi Matt,
Actually I am trying to connect to already existing DB where mentioned
table is readily available. I just need to read it all the time or
occasionally write it but I do not create it from my app. The primary
key of the table is varchar. I can do nothing about that and if i do
not declare
Somewhat unrelated, but if you're creating a new, simple Rails app,
why are you tangling with set_table_name and a noninteger primary key?
Working against the Rails conventions will cause no end of trouble,
especially if you're just starting out...
--Matt Jones
On Nov 13, 4:00 am, Kalpesh1
On Nov 13, 9:00 am, Kalpesh1 Patel rails-mailing-l...@andreas-s.net
wrote:
When I run this in browser, it throws error Wrong number of arguments
(0 for 1). Obviously, my method init_name expects one parameter and
it doesn't find any while called(by controller??). Basically I want to
send
Frederick Cheung wrote:
On Nov 13, 9:00�am, Kalpesh1 Patel rails-mailing-l...@andreas-s.net
wrote:
When I run this in browser, it throws error Wrong number of arguments
(0 for 1). Obviously, my method init_name expects one parameter and
it doesn't find any while called(by controller??).
On Fri, Nov 13, 2009 at 10:39 AM, Kalpesh1 Patel
rails-mailing-l...@andreas-s.net wrote:
Frederick Cheung wrote:
On Nov 13, 9:00�am, Kalpesh1 Patel rails-mailing-l...@andreas-s.net
wrote:
When I run this in browser, it throws error Wrong number of arguments
(0 for 1). Obviously, my method
Hi Kalpesh1 Patel
So isn't there any way I can pass some value from controller to model?
You can define cname as n attr_writer in model and can set its value
from controller like @simple.cname = 'namehere'
Sijo
--
Posted via http://www.ruby-forum.com/.
Sijo k g wrote:
Hi Kalpesh1 Patel
So isn't there any way I can pass some value from controller to model?
You can define cname as n attr_writer in model and can set its value
from controller like @simple.cname = 'namehere'
Sijo
Thanks sijo! I am able to get/set it using
Leonardo Mateo wrote:
On Fri, Nov 13, 2009 at 10:39 AM, Kalpesh1 Patel
rails-mailing-l...@andreas-s.net wrote:
when callback method is called?
Callbacks like before_create can't take any arguments
Fred
So isn't there any way I can pass some value from controller to model?
What do you
On Sep 16, 8:05 pm, RubyonRails_newbie craigwest...@googlemail.com
wrote:
Hi everyone,
I am running through the RailsSpace tutorial. I'm trying to figure out
the advanced login section, which in short creates a cookie and an
authorization token in the users table in the database.
My
On Wed, Sep 16, 2009 at 2:05 PM, RubyonRails_newbie
craigwest...@googlemail.com wrote:
I am running through the RailsSpace tutorial. I'm trying to figure out
the advanced login section, which in short creates a cookie and an
authorization token in the users table in the database.
My trouble
2009/7/3 JannaB mistressja...@hotmail.com:
I am creating a multiple-selection list box with :
% form__list1 = [] %
%= select_tag, options_for_select([A,B,C,D], selected =A),
html_options = {size = 5, multiple = true}) %
I get
wrong number of arguments (0 for 1)
alluding to
On Jul 3, 12:33 am, JannaB mistressja...@hotmail.com wrote:
I am creating a multiple-selection list box with :
% form__list1 = [] %
%= select_tag, options_for_select([A,B,C,D], selected =A),
html_options = {size = 5, multiple = true}) %
I'm not sure what the error that you're getting
On Jun 4, 10:33 am, springbok e...@infoware.com.au wrote:
Hi,
I hope someone can help me because this is driving me crazy, I've
spent hours trying to track this down. I'm trying to convert a Rails
1.1 to Rails 2.3.2 and I'm getting the following error when trying to
save a many to many
Hey,
try:
date_select(user, birthday, :start_year = 1926, :end_year =
Time.now.year-13)
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
On 4 Mar 2009, at 01:44, Zqj Zqj wrote:
Showing vendor/plugins/community_engine/app/views/users/new.html.haml
where line #40 raised:
Only time i've seen this is with plugins that fiddle with the date
helpers, globalite may well be one of them
Fred
wrong number of arguments (3 for 2)
change
session(:cart).nil?
to
session[:cart].nil?
session is not a method call
On Feb 18, 12:30 pm, Sony Sebastian rails-mailing-l...@andreas-s.net
wrote:
Hello,
I am new to ruby on rails. When I tried to create a session I am
getting an error, 'wrong number of arguments (1 for
On Feb 18, 5:44 pm, jemminger jemmin...@gmail.com wrote:
change
session(:cart).nil?
to
session[:cart].nil?
session is not a method call
If we're picking nits it is :-) - you just don't pass any arguments to
it.
Fred
--~--~-~--~~~---~--~~
You received
It would be helpful to see the CustomerController code for the new
method, but...
I have to assume that new should be called as:
session[:cart] = SessionCart.new() if session(:cart).nil?
On Feb 18, 7:30 am, Sony Sebastian rails-mailing-l...@andreas-s.net
wrote:
Hello,
I am new to
when you get the error mentioned above, there should be the rails
trace right on the same page (the part where rails tells you in which
line of your code and on which method the error occurred).
--~--~-~--~~~---~--~~
You received this message because you are
Quoting Ryan Ororie rails-mailing-l...@andreas-s.net:
[snip]
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items CartItem.new(product)
end
end
end
Your code is
nice.
On 30 Dez., 10:12, Jeffrey L. Taylor r...@abluz.dyndns.org wrote:
Quoting Ryan Ororie rails-mailing-l...@andreas-s.net:
[snip]
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
MaD wrote:
when you get the error mentioned above, there should be the rails
trace right on the same page (the part where rails tells you in which
line of your code and on which method the error occurred).
Here is the full trace:
app/models/cart.rb:13:in `initialize'
app/models/cart.rb:13:in
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items CartItem.new(product)
end
end
Try changing this to
def add_product(product)
current_item = @items.find {|item|
Freddy Andersen wrote:
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items CartItem.new(product)
end
end
Try changing this to
def add_product(product)
It might also be helpful to see my store_controller.rb file:
class StoreController ApplicationController
def index
@products = Product.find_products_for_sale
end
def add_to_cart
@cart = find_cart
product = Product.find(params[:id])
@cart.add_product(product)
end
a Sorry I see now I was thinking that the CartItem class was an
activerecord class ... The issue is this:
Here you call a new object of CartItem with a product passed
@items CartItem.new(product)
But here in the initialize you do not have a argument for
initialize...
class CartItem
You're going to have to isolate what line the error originates from on
your application by going through the Rails trace information,
otherwise we're all going to be here forever trying to figure out what
the problem is.
On Dec 30, 1:22 am, Ryan Ororie rails-mailing-l...@andreas-s.net
wrote:
Matt wrote:
You're going to have to isolate what line the error originates from on
your application by going through the Rails trace information,
otherwise we're all going to be here forever trying to figure out what
the problem is.
On Dec 30, 1:22�am, Ryan Ororie
Frederick Cheung wrote:
On Dec 10, 5:36�am, Jay Mark [EMAIL PROTECTED] wrote:
Rails?
Is subselect not supported in Rails?
For the sake of argument you can do
@books = Books.find_by_sql [SELECT * FROM books WHERE title IN
(SELECT
title FROM authors WHERE name = ?),
Here is the result from ruby script/console
Author.new
= #Author id: nil, name: , title: , book_id: nil
Book.new
= #Book id: nil, title: , isbn:
Ryan Bigg wrote:
Ok... then you're on your own if you don't know how to type ruby
script/console into a command prompt window and then type
Ryan Bigg wrote:
And finally, what version of Rails?
-
Ryan Bigg
Freelancer
http://frozenplague.net
I am using 2.0.2 with mysql database
Cypray
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are
I have no clue. Author.find_by_name should be working when it
(apparently) is not. Something is broken.
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 10/12/2008, at 8:44 AM, Jay Mark wrote:
Ryan Bigg wrote:
And finally, what version of Rails?
-
Ryan Bigg
Freelancer
Ryan Bigg wrote:
I have no clue. Author.find_by_name should be working when it
(apparently) is not. Something is broken.
-
Ryan Bigg
Freelancer
http://frozenplague.net
I think so too. Thanks for your help.
Why is it so hard to find the correct syntax for doing a subselect in
Rails?
Is
It's supported. It's the syntax I showed you before:
Author.find_by_name(Blah).books, will get you all the books by that
author.
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 10/12/2008, at 3:36 PM, Jay Mark wrote:
Ryan Bigg wrote:
I have no clue. Author.find_by_name should
On 8 Dec 2008, at 16:30, Jay Mark wrote:
I am using Rails 2.0.2 with mysql database
I am getting this error when running a query with Find_by_sql:
wrong number of arguments (0 for 1)
Here are my queries:
@authors = Author.find_by_sql[SELECT * FROM authors WHERE name = ?',
name]
Also
Thanks for your help Fred. The wrong number of argument problem is gone.
The queries are still not working.
Using find_all_by_name give me method not found error
This one below returns no data but gives no error. But it works fine
when I put it in mysql directly.
@authors =
On Dec 8, 7:31 pm, Jay Mark [EMAIL PROTECTED] wrote:
Thanks for your help Fred. The wrong number of argument problem is gone.
The queries are still not working.
Using find_all_by_name give me method not found error
That should work as long as the argument you pass it exists (and as
long
Thanks again Fred.
NO, I am not asking for the author whose name is the exact string
'name'.
Name is the attribute or column in the authors table which has name
values like James, John, etc. The user will select a name, say John,
then I am passing that name as a condition to the query.
After a
On 8 Dec 2008, at 22:53, Jay Mark wrote:
Thanks again Fred.
NO, I am not asking for the author whose name is the exact string
'name'.
Name is the attribute or column in the authors table which has name
values like James, John, etc. The user will select a name, say John,
then I am passing
If it's coming in dynamically, wouldn't it be params[:author][:name]
or something similar? A bit hard to guess without seeing more code.
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 09/12/2008, at 9:30 AM, Frederick Cheung wrote:
On 8 Dec 2008, at 22:53, Jay Mark wrote:
On 8 Dec 2008, at 23:36, Ryan Bigg wrote:
If it's coming in dynamically, wouldn't it be params[:author][:name]
or something similar? A bit hard to guess without seeing more code.
D'oh of course, not sure why I wrote author[:name]
Fred
-
Ryan Bigg
Freelancer
http://frozenplague.net
Thanks guys, the first query is working fine now.
Rails is still rejecting the syntax of this subselect:
@books = Books.find_by_sql [SELECT * FROM books WHERE title IN SELECT
title FROM authors WHERE name = ?, params[:author][:name]]
I know the inner select should be in (), but its not taking
Stop using find_by_sql!
You can just do:
author = Author.find_by_name(params[:author][:name])
books = author.books.find(:all, :select = title)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
I am using find_by_sql because I get this error when I use find_by_name
or
find_all_by_name
undefined method `find_by_name' for #Class:
I get it again when I put in the code in the last post.
Is there a way to solve the undefined method problem?
Cypray
Ryan Bigg wrote:
Stop using
pastie your models please
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 09/12/2008, at 2:14 PM, Jay Mark wrote:
I am using find_by_sql because I get this error when I use
find_by_name
or
find_all_by_name
undefined method `find_by_name' for #Class:
I get it again when I
Here are my models:
class Author ActiveRecord::Base
belongs_to :book
end
class Book ActiveRecord::Base
has_many :authors
end
Ryan Bigg wrote:
pastie your models please
-
Ryan Bigg
Freelancer
http://frozenplague.net
--
Posted via http://www.ruby-forum.com/.
And in the console do Author.new and Book.new and show me the output
of each please.
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 09/12/2008, at 2:44 PM, Jay Mark wrote:
Here are my models:
class Author ActiveRecord::Base
belongs_to :book
end
class Book
It says:
Author.new is not recognized as an internal or external command,
operable program or batch file.
same for Book.
Ryan Bigg wrote:
And in the console do Author.new and Book.new and show me the output
of each please.
-
Ryan Bigg
Freelancer
http://frozenplague.net
--
Posted
I meant doing it in ruby script/console, not just in the command
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 09/12/2008, at 3:03 PM, Jay Mark wrote:
It says:
Author.new is not recognized as an internal or external command,
operable program or batch file.
same for Book.
Ok... then you're on your own if you don't know how to type ruby
script/console into a command prompt window and then type some more
stuff
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 09/12/2008, at 3:16 PM, Jay Mark wrote:
I am using InstantRails. All I have is the command
Juste before trying to migrate thie table clubs, I did it fine with
league:
class CreateLeagues ActiveRecord::Migration
def self.up
create_table :leagues do |t|
t.columns :name, :string
t.columns :ref, :string
t.columns :description, :string
t.columns :category,
On Oct 24, 2008, at 9:40 AM, Thierry Delbart wrote:
Juste before trying to migrate thie table clubs, I did it fine with
league:
class CreateLeagues ActiveRecord::Migration
def self.up
create_table :leagues do |t|
t.columns :name, :string
t.columns :ref, :string
59 matches
Mail list logo