Displaying 20 results from an estimated 20000 matches similar to: "A "virtual model" that encapsulates other models?"
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 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 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 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
2008 Oct 06
1
Postfix, Dovecot, SASL, and Virtual Domains
My saga continues, with a few interruptions, to configure a new mail
server for several domains.
I've had one private post, and read a dozen of more HOWTOs, HOWDONEs,
blogs, and posts on doing this but still haven't had any joy. Not quite
sure what I got configured incorrectly so before doing more work on this
I'll ask if what I'm trying to do is doable.
Postfix:
mydomain
2007 Nov 20
2
confirming that a model instance was correctly created from POST params
I''m wondering whether I''m wasting my time trying to verify that an addition I''ve made to legacy code is in fact setting a new attribute on a model.
Substruct''s (http://dev.subimage.com/projects/substruct) OrderHelper contains this method:
1 def create_order_from_post
2 @use_separate_shipping_address = params[:use_separate_shipping_address]
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 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 Jul 21
3
How can I create OrderItems that go in a Order?
I suspect my problem is similar to having an order and wanting to have
order items as part of the order, so I''ll explain the problem in those
more familiar terms and then explain what if anything makes my actual
situation different at the end.
In an Order lets say you have: shipping_address and a shipped bool.
OrderItem has quantity and name
So Order has_many :OrderItems, and OrderItem
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 12
1
Does rails support method overloading?
I''ve tried to have 2 methods of the same name (but with different
parameter signatures) and it always seems like the later declaration
tends to win out, does this mean that ruby does not support overloading?
If so what aboutt the .new method? You can either call it as .new (with
nothing) or .new(hash variable). Is it possible to override a specific
instance of the zero parameter
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/.
2009 Feb 26
1
composed_of, aggregate object isn't saved
I am relatively new to rails and I cannot figure out what is going on
here. I am using the composed_of method in an ActiveRecord class to
create two aggregate properties: shipping_address and billing_address.
The object properties are getting populated from the form and validation
is working - no problem. When I call order.save, though, everything is
being saved except the address fields. I am not
2004 Oct 09
1
Ogg encapsulation...
I'm about to do the new version of the ogg mapping and i have a few
questions...
Here's my understanding so far...
There's a new first header... which is a header like the other ogg
headers... with some general info, and with a stream info metadata block
stuck to the end of it.
The next packet must be a vorbis comment meta data block, then meta data
blocks in any order and of
2006 Mar 31
1
Active Record: subclassing a model
Hi there,
I have a model
class Account < ActiveRecord::Base
has_many: projects
The accounts table holds company information so as I created another
model to represent project partners thus:
class Partner < Account
has_and_belongs_to_many :projects
#project.account pulls up the project owner and #project.partners pulls
up all partners, including the owner.
Now, this all seems to
2005 Nov 03
0
AR model and virtual attributes
i have a need to create a ''virtual'' attribute. Is the following possible?
class User < ActiveRecord::Base
# user things are owned by user at his selected location
has_many :owned_things, :class_name => "Thing", :conditions => ''user_id =
#{id} and location_id = #{location_id}''
attr_accessor :location_id
end
class AccountController <
2016 Aug 10
0
Samba4 AD/DC and Virtual Machines?
> On Aug 9, 2016, at 9:14 PM, Mark Foley via samba <samba at lists.samba.org> wrote:
>
> Can Samba4 be used for AD/DC with virtual machines? For example, I have a Ubuntu domain member
> and it currently does AD authentication for users. I would like to run this computer as a VM
> also hosting Windows 7, which I would also like the Windows 7 user(s) to AD authenticate.
>
2007 Jun 20
1
[LLVMdev] Runtime optimization of C++ code with virtual functions
On Jun 19, 2007, at 1:43 AM, Chris Lattner wrote:
> On Sat, 16 Jun 2007, [ISO-8859-1] Stéphane Letz wrote:
>> At runtime after a graph is created, one could imagine optimizing by
>> resolving call to "virtual Compute" and possibly get a more
>> efficient Compute method for the entire graph, so that we could
>> write:
>>
>> DSP* graph = new
2016 Aug 10
2
Samba4 AD/DC and Virtual Machines?
Can Samba4 be used for AD/DC with virtual machines? For example, I have a Ubuntu domain member
and it currently does AD authentication for users. I would like to run this computer as a VM
also hosting Windows 7, which I would also like the Windows 7 user(s) to AD authenticate.
One problem I foresee is joining the computer to the domain. I imagine there is only one IP
address. If I join the WIN7