similar to: looping

Displaying 20 results from an estimated 1700 matches similar to: "looping"

2006 Mar 07
6
form_tag - directing to new target window
How do I use... <%= link_to "All Facilities", :action => ''fac_log_all'' %> if I add :target => "_new" that is just a parameter and not a directive. I just want reports to print into a separate window. How do I do that? It''s not clear at all to me Craig
2006 Feb 08
2
compound conditions in find
can''t seem to find the right syntax for this... /script/../config/../app/controllers/placements_controller.rb:155: syntax error :conditions => [["placements.client_id = ?", params[:client_id] ] and "placements.discharge_date IS NOT NULL" ], this part works... :conditions => ["placements.client_id = ?", params[:client_id] ] this is what I
2006 Feb 18
1
sql logic is killing me
I know my thinking is sloppy. I want to know how many clients currently in my facility are male... My facilities_controller.rb def list_fac @placement_pages, @placements = paginate( :placements, :conditions => ["placements.facility_id = ?", params[:facility_id] ], :include => [:facility, :client], :order_by => ''facilities.name,
2006 Feb 19
8
building multiple find conditions
I am trying to allow for AND type ''find'' but to allow for simply a single set of find criteria. controller code... @vw_string = @vw_string1 = @vw_string2 = @vw_string3 = [] if params[:beg_intake_date] != "" then @vw_string1 = ["intake_date between ? and ?", params[:beg_intake_date], params[:end_intake_date] ] end if
2006 Mar 16
32
iterating a partial with :collection
following AWDWR book - ''Partials and Collections'' (rather sparse info there too) and I might add that the wiki page on this topic is entirely devoid of any info...be that as it may... I have hash of several arrays that I want to iterate though and display. the first hashed element looks like this (greatly simplified) - :facility: !ruby/object:Facility attributes:
2006 Mar 22
3
strange issue locating a file
I have been editing a branch on my Fedora system, completed the changes and was satisfied that it works and using svn, merged it to my main trunk. I have been testing the main trunk and it seems fine. I committed my changes to the svn repository. On my live web application, I did an ''svn update'' which brought all the files in but when I launch, I get an error on my
2006 Feb 28
2
sorting collection lists
I''m using collection.select lists and I would love to sort them by one or two of the columns as the lists are getting long enough to make a difference. <%= options = [[''Select a Facility'', '''']] + @facility.collect { |fac| [fac.name, fac.id] } select ''placement'', ''facility_id'', options %>
2007 Oct 25
1
find - group - postgres
I am not sure that this is entirely a rails question as I am trying to run the command in postgres and I am getting the same error... controller code... @client_slot_count = ClientSlotsDaily.find(:all, :conditions => ["created_at > ? AND created_at < ? AND facility_id = ? AND client_id IS NOT NULL", starting_date, ending_date, @facility.id],
2012 Apr 23
1
Searching and returning arrays
im a begginer in RoR and am using rails 3.2.3 and ruby 1.8.7 This forum has helped me to progress but I''m confused by one thing. My app is supposed to allow seaching for results depending on the check boxes that are checked. In my case, when the user checks a determined facility and clicks "search" the corresponding hotels with only those facilities should be returned. I can
2006 Feb 19
2
progressive updates
I have a list view and have it sorting the data presented in the list view by clicking on the top of the column - that works fine. Now, I want to add a pop up-list which controls 3 different levels of record select to be presented in this list... - ALL - placement.discharge_date IS NULL - placement.discharge_date IS NOT NULL I can have 3 different ''methods'' and
2006 Mar 25
1
foreign keys on migration
I have reached a development plateau and now want to integrate some of the rails niceties that I passed over to get the system online. I am fooling with migrations. I am using postgresql. I put in my migration script (at the end of the ''up'' method, the following raw sql code... # set up primary key restratints for PostgreSQL execute ''ALTER TABLE ONLY
2006 Mar 07
0
API Suggestion
It''s not intuitive to have two hashes on any one method call. Most of the view helpers have a hash for method options followed by a hash for html options. I find it to be problematic at best. I think it would be best to have one hash and then add your html options as a hash entry. For example: <%= link_to "All Facilities", {:action =>
2008 Jun 28
14
Date Field convert to Seconds since Epoch
Hi, I was wandering if anyone could help me with this problem: Right now I am using a field in my database which is of type ''Date'' (in the form dd-mm-yyyy). I would like to convert this value (for example 26-06-08) into a number of seconds since epoch or into another form so I can compare it with todays date (from Date.now) so that I can tell the difference between the two dates
2006 Feb 07
11
breaking down a list view
I''m trying to figure out how to change the order of a list view and it''s obvious to me that I don''t understand what I get from a simple scaffold to know enough to alter it. If someone would be so kind to tell me what this means ... def list @placment_pages, @placements = paginate :placements, :per_page => 10 end @placement_pages, # I am guessing that this
2006 Feb 08
7
DRY methodology
because I am a grasshopper... Now that I can sort my ''list''...is there a logical way of not repeating myself to having essentially the same list view with multiple sorts? i.e. def list_cl # ordered by clients last name @placement_pages, @placements = paginate( :placements, :include => [:client], :order_by =>
2006 Mar 14
2
autocomplete using other models
I''ve asked this in various ways but I can''t seem to get much traction - my guess is because not many people are doing this. I am working in a controller/views called placements. Placements belongs_to :client I have a clients model/table - clients has_many :placements in placements/find...this works fine... <%= text_field_with_auto_complete :placement, :clwholename, {} %>
2006 Feb 06
3
linked table confusion
placement.rb has_one :client has_one :case_manager client.rb belongs_to :case_manager has_many :placements case_manager.rb has_many :clients has_many :placements I am trying to create a view file for placements. I can pull columns from clients table in this view by using... <%= @placement.client.wholename %> but if I use <% @placement.case_manager.wholename %>
2006 Feb 06
2
basic usage confusion
I am confused. Looking at ''list'' from scaffold, I see a record and click the ''show'' button. I put in a ''link'' at the bottom of ''show.rhtml'' to my ''view'' rfn2.rhtml - action = ''rfn2'', :id = @placement I click this link and get error... log/development.log Processing
2006 Mar 10
3
css question
I''m doing this ''partial'' to do some ajax auto_complete <ul class="placements"> <% for client in @clients do -%> <li class="placements"> <div class="clwholename"><%=h client.clwholename %></div> <div class="id><span class="informal"><%= client.id
2019 May 06
2
[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
> +/** > + * drm_gem_vram_unpin() - Unpins a GEM VRAM object > + * @gbo: the GEM VRAM object > + * > + * Returns: > + * 0 on success, or > + * a negative error code otherwise. > + */ > +int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) > +{ > + int i, ret; > + struct ttm_operation_ctx ctx = { false, false }; > + > + if (!gbo->pin_count) > +