similar to: :include breaks has_many :order

Displaying 20 results from an estimated 3000 matches similar to: ":include breaks has_many :order"

2006 Jul 22
5
Prototype error. replace content inside a <TR> in IE
Does anyone know of a fix for the issue with prototype and replacing table rows in IE? render :update do |page| page.replace "row_#{params[:id]}", :partial => ''wireless_request/wrequest'', :locals => {:wrequest => @wrequest} end This ends up making IE throw an "rjs error [object error]" Searching around I found a couple of posts about
2006 Jun 26
8
[Semi OT] BlindDown and a floated div
I am using the drop shadow technique described at http://www.1976design.com/blog/archive/2003/11/14/shadows/ to give several of my divs drop shadows. That part works fine. What doesn''t work so well is when I try to BlindDown a div in Firefox and it ends up ignoring the content below it and just overlapping it. In IE this problem does not occur. In Firefox the overlapping does
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 Jun 19
6
SQL Search Qustion
I am working on writing a search method where a user can type a string of words and I return all the objects that have fields that match all of the words in one or a combination of fields. Person first_name last_name Pet name Person has_many :pets I want to write some SQL so that if I search for "Tony AAAA" I will get all the people who have Tony and AAA either in their
2006 Jun 14
3
Which Payment Gateway?
I am working on an application where users sign up for one of several plans. Each plan has a different monthly fee. There is no long term contract but I would like to bill the users automatically each month unless service is canceled. What credit card gateways would you recommend for use with a rails application? My criteria in order of importance are 1. API that will let me work in
2007 Feb 03
1
How can I bypass caching for some users
I have action caching setup for several actions of an application but I want the caching to only run for my administrators and have all other users see non-cached pages. Is there a way to do this? Perhaps something like passing a block to caches_action or setting some sort of flag in my authentication method? If this is not possible with action or fragment caching does anyone know of a
2006 Jun 20
2
Validation error_messages_for problem
I am having trouble getting error_messages_for to work. My controller(relevant parts) looks like def configure @account = session[:account] @user = User.new end def add_new_user_to_account @user = User.new(params[:user]) if @user.valid? session[:account].users << @user end redirect_to :action=> ''configure'' end end and my
2011 Jan 16
4
persistence by reachability
Hello guys, I have these models class Farmer < ActiveRecord::Base has_many :cows end class Cow < ActiveRecord::Base set_table_name :cows belongs_to :farmer end ... graph = Farmer.find(x) # Retrieves four cows of x graph.cows[1].name = "Trottolina" graph.save while adding a new cow to collection works perfectly fine, ActiveRecord doesn''t
2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running my own methods authorize and admin_authorize. authorize is called on just about every action to make sure that a user is logged in. admin_authorize is called on about 80% of the actions and is used to make sure that a user is an administrator. If a user tries to access an admin_authorize protected action without being
2006 Jul 01
6
Sorting by an attribute on a associated table
So, I have a User has_many :profiles. The most recently dated profile is considered the current one. I need to sort these users by name, but the name attribute is a member of the associated table. Is there any easy way to do this other than with some ugly find_by_sql? Maybe a more general question - is there a common solution to sorting in Ruby? -- Posted via http://www.ruby-forum.com/.
2006 Jun 16
2
[Slightly Off Topic]How to handle downgrades
Let''s say that there is a web application which comes in several different plans. Each plan has a different number of users and content items allowed for an account. Obviously we can allow the user to upgrade to a higher level plan by just increasing their limits but how do we handle downgrades? If the user is only allowed x items on the downgraded plan and they currently have
2006 Jul 31
3
date_select for valid days only. No Feb 30
I am looking for some advice on how to make a date select display only valid days of the year. The standard date helper allows for you to choose 31 days for every month of the year. Since not all months have 31 days this can lead to invalid date entries for scheduling. I am thinking that an approach where I have a drop down for month and then use AJAX or normal client side javascript to
2006 Jun 23
2
Queue 3 or more RJS actions
My .rjs file page.visual_effect :BlindUp, "people", :queue => ''front'' #first action page.replace_html "people", :partial => ''person/person_compressed'', :collection => @search_results , :queue => ''end'' #second action, after first is done page.visual_effect :BlindDown, "people" , :queue =>
2007 Sep 21
3
Standardize environment between specs containing class defs
I have some specs that involve the use of eval and class definitions to test code generation. I want to always start with a clean slate so none of my tests fail or succeed incorrectly due to artifacts left over from previous specs. Example of my situation Spec 1 defines class Fish class Cod < Fish Spec 2 defines class Animal class Cod < Animal In this situation the
2006 Mar 08
12
best way to combine results from two tables
I want to combine a selection of data from two tables and display it as list. Note that this isn''t a join. i''m looking for something like this: Table 1: Sheep Name, Age, Farmer, etc. (sheep specific columns) Table 2: Cows: Name, Age, Farmer, etc. (cow specific columns) For my display I nneed something like this: Farmer Jone''s Livestock: TYPE NAME AGE Cow
2006 Jul 17
5
Keeping attributes of two models in sync
Hi, I have a Product and a corresponding Keyword (1:1 via belongs_to and has_one). I want to ensure, that two attributes (:name) of the two models alway stay in sync. What''s the easiest way to accomplish that? I did play around with before_/after_save hooks and with AR::Observers but in the end I''d always get infinite recursion... Thanks, Timo
2006 Jul 31
3
programmer needed (paying work)
hello, I''m currently looking for a html/css/ajax/rails programmer. if your interested please email neumanc@gmail.com. I have paying work, will pay via check, money order, paypal or credit card. I''m not sure if I can post this here or not. if not, please remove and email me a warning as I did not see any rules on signup. Thanks -- Posted via http://www.ruby-forum.com/.
2006 Jul 16
7
RJS and Action Renders but page doesn''t update
All, I am trying to perform a simple ajax task and am having some difficulties with the page showing the response. The action performs, but no response on the page. I have found examples on the web and I believe I have copied and pasted exactly what works from the demo site. However, on my system it isn''t finishing. For a simple test, I have limited it down to an alert.
2006 Jul 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the examples in the second edition Agile book. I have everything working except for the RJS that removes items from the cart. Ideally what I''d like to do is highlight an element that I am deleting only if there is more than one of that particular item in the cart. If the item deleted is the only of
2006 Jun 27
2
Capistrano Documentation
Can anyone tell me what was used to create the Capistrano documents by Jamis? http://manuals.rubyonrails.com/read/chapter/97