search for: awdr

Displaying 20 results from an estimated 56 matches for "awdr".

Did you mean: addr
2008 Jul 14
1
question about method "hidden_div_if" in AWDR 2
I followed the sample code in AWDR 2 like this: store_helper.rb def hidden_div_if(conditions, attributes = {}) if conditions attributes["style"] = "display:none" else attr = tag_options(attributes.stringify_keys) "<div #{attr}>" end end store.html.erb <%= hidden_div_if(@ca...
2006 Aug 01
1
AWDR Edition 2 Gripe
Maybe it''s just me.. But the cover is hideous. I love the first edition cover, it seems to fit perfectly. The new "hip" cover is a bad choice, in my opinion. Comments? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060801/043f6ec1/attachment-0001.html
2006 Apr 28
9
[AWDR] Tutorial in A4 wont ''destroy'' items
Hello, I''m working through the tutorial, and I''ve run into a little snag. In the first part of the tutorial, the destroy link is not working correctly. I can''t figure out where I goofed. Removing :confirm doesn''t seem to resolve the issue. Thanks, Randy. development.log ----->8----- Processing AdminController#destroy (for 127.0.0.1 at 2006-04-27
2006 Mar 12
2
counter_cache reference/tutorial
I''m trying to use counter_cache, but I''m not doing something right. It is unreliable and I keep having to correct it manually. Is there a good tutorial or reference on how to use it on-line? I have the AWDR book, but I need something more complete. TIA, Jeffrey
2006 Jul 22
4
Reading floating points into a field stored as Integers
Hi, I''m trying to follow the "AWDR" example of storing certain types of numbers (in my case, percentages not money) as integers in the database. I understand from the Depot application how to format the output to have 2 places (or n places for that matter) decimal. Now, I"m wondering about the input. It''s mo...
2006 Apr 10
2
using web service for authenitcation
...:invoke for testing it out...and was able to consume it using .NET. But my question is, whats the simplest method using which i can use the same web service in the current Web App. I mean, not from an external application or something but from the current web apps itself. I found one method in AWDR, and was: class MyController < ApplicationController web_client_api :product, :soap, "http://my.app.com/backend/api" def list @products = product.find_all_products.map do |id| product.find_product_by_id(id) end end end but this is...
2006 Jun 25
6
Understanding Common Views
...the 5 most recent events, etc. 3. I''ve seen a bit about putting things into "shared/partials" and "views/layouts" and I''m not sure what belongs where :-S I think my confusion is between "views" and "layouts".. but I just got hold of the AWDR book (PDF) and also the main article that I found that explains some of this [1] and hopefully will be able to understand some of this a bit better. So, I am reading on but I hope some of you can explain these concepts as you are applying them. Anything else that comes to mind at this stage?...
2006 May 16
4
Model class conditional on ENV["RAILS_ENV"] == "test"
I am trying to setup a model class that I want to inherit from ActveRecord when in the test mode, and not inherit when in production and/or development mode. The reason for this is so that I can use fixtures to test that the logic in the model is working correctly, but I don''t want the database table around during production (and normal development). I would like to do this the
2006 Apr 03
5
Strange Problem with ActionController (I think)
I''m working through the Agile Depot example I have no idea what I did, but when I try and delete something from the web page I get this error on the log. Processing AdminController#destroy (for 127.0.0.1 at 2006-04-02 22:28:06) [GET] Session ID: 4371bd7ca2cb5ec5e08e60a7590df90a Parameters: {"action"=>"destroy", "id"=>"5",
2006 Aug 01
0
Validation of facade columns
I''m having difficulty understanding how to make validation of facade columns consistent with validation of other active record columns. To illustrate this, I''m going to extend the facade column example discussed on pp. 284-5 of AWDR. Let''s say that there is a "rectangles" table that has width and height columns. For some unknown reason, width is stored in inches and length is stored in cubits. Since I want the model to expose both measurements in inches, I''ve made length a facade column as discussed...
2006 Jun 23
10
Don''t un-admin the last administrator
I have a User class with a field called admin which is a boolean that determines if the user is or is not an administrator. I want to make it impossible for the last administrator for an account to be removed from the system. I need to protect against this both when deleting a user and when editing a user as you can revoke a user''s administrator privileges via a form. User
2006 Jul 13
6
Migrations + foreign keys
Hi all, In the AWDR author use the execute method to declare foreign keys: execute "alter table.... add constraint.... foreign key...." Is there a ruby sintax to declare a foreign key in a migration class? -- Posted via http://www.ruby-forum.com/.
2006 Mar 31
3
params vs @params
Is there a difference in the way that params[] and @params[] are handled? Is the ''handling'' done by Ruby or Rails? A pointer to the relevant documentation would be sincerely appreciated. Or just an answer would be ok too ;-) Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 21
2
Nooby partials / component problems
...yles in HEAD, the content_for_layout, etc. are all there like normal - its just like the render_component has no effect unless there''s an error in it. So then I decided to try using a partial, since it seemed a little more "foolproof", and somewhat based on the mention in AWDR v2 that components are not as favored. So I added: <% render :partial => ''shared/footer'' %> to my application level template and just added some plain ole hard- coded HTML in views/shared/_footer.rhtml Weirdly, nothing comes out in my template. It seems that the fil...
2006 May 20
10
HOW TO create a new record and its associated objects within the SAME PAGE
hi, can''t find any good tutorial or advice to deal with the creation of a new record and it''s associated objects within the same page. do i have to use ajax just to add custom form fields that will be handled by the controller for associated objects creation.? do i have to use ajax to add associated objects to the unsaved but allready in session parent object? what''s
2006 Feb 08
1
Adding children via small subform
I''ve read AWDR and especially the part concerning adding child line_items to an order. Unfortunately I want to do my process in reverse and in doing what I thought would work I get a null object error when trying to append the children to the parent. This is a _major_ stumbling block in my Rails use as almost e...
2006 Mar 10
9
Observers?
...rver.rb > class VehicleObserver < ActiveRecord::Observer > def after_save(vehicle) > breakpoint > if vehicle.has_new_mil_indication? > UserMailer.deliver_mil_notice(vehicle) > end > end > end > > VehicleObserver.instance It seems from reading AWDR that the last line may not be necessary for Rails apps, though it appears that if it isn''t there you can only specify when observations take place via the observer command in Controllers. I want to observe ALL saves to Vehicle, not just ones generated via a controller. In fact, the v...
2006 Apr 27
6
Functional Test Problem. Nubee, please help
ALl my controllers require the user to be logged in. SO they will be redirected to my "login" controller. How do i login first in a functional test? Im assuming i use the setup method to login the controller. This is the setup method for the Activities controller functional test: def setup @controller = ActivitiesController.new @request =
2006 Feb 18
6
Why doesn''t my "action" take action?
I have the following code in my index.rhtml: <div id="how_many_images" style="background-color:#eee;"> <%= render(:partial => ''form'') %></div> ...and the following in my _form.rhtml <%= form_remote_tag(:update => "images_div_main", :url => { :action =>
2006 Jan 19
4
Can the session be trusted for Username/password?
I understand that a session is server side, and not externally visible. For this reason can it be used to store a User class (username/ hashed password) safely? Or do I need to check whats in the session against the user table every time I access a controller? Many thanks, P. -- Posted via http://www.ruby-forum.com/.