similar to: Does rails support method overloading?

Displaying 20 results from an estimated 2000 matches similar to: "Does rails support method overloading?"

2006 Mar 21
13
"Remembering" link to redirect to after logging in
Hi, Suppose I have a resource such as http://localhost:3000/topsecret/data that requires the user to login first. What I did was make use of before_filter to check and see if the session variable is set with the logged in user''s id (similar to the example in "Agile Web Development with Rails"). However while the filtering function does work correctly in redirecting the
2006 Jan 13
5
Form field naming semantics question
Hi, I have a question today regarding how the various form elements in _form.rhtml are named. I understand that for a database table "persons" with a column headed by "name", then in _form.rhtml it will probably be like: <p><label for="person_name">Name><br/> <%= text_field ''person'', ''name''
2006 Mar 21
4
Using onSubmit tag in form_tag?
Hi guys, I have been working on a form that would use javascript to validate the data before submitting it, and from my view.rhtml I have a statement like this: However such a statement generates a HTML tag that looks like this: <form action="/users/Login?onSubmit=validate%28%29" method="post"> Seems like Rails thinks it is a parameter instead of an option, so
2006 Mar 23
1
Implementing a model with logging?
Hi, I''ve been trying to work out a model (let''s say a StudentRecord) which has a number of attributes, and the key thing I''m trying to do here is to implement it such that you can actually view modifications made over time by various users (think of it as a wikipedia style of logging). Is there some provision in rails that''d provide this functionality for
2006 Feb 04
1
Error when using form helper and child objects
Hi, This is one problem that has gotten me stumped for quite a while. I have an Item that has_many :DeliveryMethod, and what I seek to achieve is to create a form that''d let me create an Item, as well as its DeliveryMethods in 1 single form. And so I tried something like: <%= text_field_tag ''Item[DeliveryMethod][price]'', @Item.DeliveryMethod ?
2006 Jan 17
2
Instant Rails request lags >4 sec
Hello RoR folks, I am using Instant Rails and a small app that currently uses scaffolding for CRUD on just one table with 7 attributes. I am not shure wether scaffolding slows down the app that much but I have a time lag for every request with above 4 sec. The preinstalled apps like Type are running damn fast, which is not the case for my stuff. Any help on this would be great Thanks, RTG --
2006 Mar 24
1
Modifying a session variable from a different process?
Hi, I''ve implemented a log in session "thing" that essentially works by holding the model of the logged in user in a session variable, like this: session[:user] = user However let''s say at this point in time, should an administrator of the system decide to revoke this user''s account, the session variable for that currently logged in user is still valid,
2006 Jan 14
2
Why can''t I changed the _session_id cookie?
Hi, I noticed that there is a cookie set by my rails scaffold that contains a 32 character hash code in it, but when I tried to change its value using Cookies[:_session_id], nothing happened, it stays the same! How am I supposed to change the session_id? Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Jan 18
22
Creating multiple child objects from the same form
I''ve been digging into rails, but this one question has been a two day stumper. I''ve got a question/answer model that I''m trying to work out. Each question has multiple answers (they''re more like choices, it doesn''t matter whether they''re right or wrong), and I''d like to have the question creation form also have multiple fields in
2006 Feb 03
7
how to add multiple new records from one form
I''m trying to provide our customers with a page where they can add up to 20 items to their cart in one form. The form simply has 20 rows with each row containing a text input for product code and a text input for quantity. I''ve tried having the controller create an array that has an object for each row by looping through something like: @new_items[1] = Cart.new and the
2018 Jan 02
3
Help with first S3-class
Hi, I am trying to understand S3 classes. I have read several tutorials about the topics but I am still a bit confused. I guess it is because it is so different from Java OOP. I have pasted my attempt at creating a bank-account class below and my problems are: 1. What should be added some plot.default() calls the account$plot() method ? 2. What should the account$plot() be implemented to
2018 Jan 02
0
Help with first S3-class
On 02/01/2018 6:38 PM, Martin M?ller Skarbiniks Pedersen wrote: > Hi, > > I am trying to understand S3 classes. I have read several tutorials about > the topics but I am still a bit confused. I guess it is because it is > so different from > Java OOP. What you do below isn't S3. S3 is a system where the classes are secondary to the generic functions. Methods
2008 Mar 28
3
IMAP security
I have port 143 open so that I can get my mail when away from home. Occasionally, though, my router reports things like Thu, 2008-03-27 02:00:11 - TCP Packet - Source:200.122.134.9,3821 Destination:88.97.17.41,143 - [IMAP rule match] Thu, 2008-03-27 05:39:49 - TCP Packet - Source:140.127.181.141,3461 Destination:88.97.17.41,143 - [IMAP rule match] Thu, 2008-03-27 16:10:03 - TCP Packet -
2010 Mar 23
1
Operator overloading for custom classes
Hi, I need some help to get some of the object orientation, specifically the methods that overload the basic arithmetic operations, from sample C++ code to R. I don't have experience with such advanced language features inside of R. So I was wondering if some of you could help me out in this regard. I have written a simple demonstration of a forward mode automatic differentiator in C++ and
2011 Jun 01
1
Overloading S4 methods
Dear all, I am experiencing some problems with S4 method overloading. I have defined a generic for graphics:plot, using setGeneric("plot", useAsDefault = plot) and with importFrom('graphics', 'plot') and exportMethods('plot') in the NAMESPACE file of pkg A. I then proceed to define a method for signature c('myS4class', 'missing'). This works
2004 May 26
1
Bindings and overloading
This is going to be a problem. I don't appear to be able to rename a method once it's declared. So if the core bindings file declares some overloaded operators, functions or constructors, it's impossible to move them out of the way in only some of the bindings. Since Python supports overloading, I can't think of any solution to this other than maintaining two different xapian.i
2016 Jul 26
2
Help wanted: Overloading an Intinsic
Hello All, I have been modifying LLVM a project of mine, and have encountered issues with overloading an intrinsic function. I have defined two types, abit (which is mapped, in Intrinsics.td, to i128) and qbit (accordingly mapped to i16). I would like my intrinsic function, CNOT(x,y), to accept either an abit or a qbit for each argument, so I overload with iAny and llvm_anyint_ty, as seemed to
2010 Mar 23
1
: Operator overloading for custom classes
Hi, I need some help to get some of the object orientation, specifically the methods that overload the basic arithmetic operations, from sample C++ code to R. I don't have experience with such advanced language features inside of R. So I was wondering if some of you could help me out in this regard. I have written a simple demonstration of a forward mode automatic differentiator in C++ and
2016 Jul 28
0
Help wanted: Overloading an Intinsic
Hi David, The error shows that the clang source code uses this intrinsic as well, but in the old form. You need to modify the clang source code (where this intrinsic is used) to consider the overloaded operands. The assert would show the trace where clang uses this intrinsic. Hope this helps, Anna > On Jul 26, 2016, at 3:21 PM, David Noursi via llvm-dev <llvm-dev at lists.llvm.org>
2012 Nov 29
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
For the given test: class A1 { int x; int y; public: A1(int a, int b) { x=a; y=b; } A1 operator+(const A1&); }; A1 A1::operator+(const A1& second) { A1 sum(0,0); sum.x = x + second.x; sum.y = y + second.y; return (sum); } int main (void) { A1 one(2,3); A1 two(4,5); return 0; } when the exectable of this code is debugged in gdb for i386, we dont get the