similar to: Puzzled with form on multiple table rows

Displaying 20 results from an estimated 700 matches similar to: "Puzzled with form on multiple table rows"

2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render 404" case, but it seems the RecordNotFound exception is making it impossible for some reason. #controller def show @event = Event.find(params[:id]) end #spec - pretty much straight from the rspec site before do Event.stub!(:find) get :show, :id => ''broken'' end #
2009 Sep 24
4
Action Controller ::MethodNotAllowed
Hi, Iam getting the following error ActionController::MethodNotAllowed Only get, put and delete requests are allowed. Actually, Iam trying to have multiple actions for a form to create new record. The actions for the form are cancel, save, publish and preview. here''s the config/routes.rb file code snippet for the relevant controller - Events map.resources :events, :member =>
2011 Nov 22
4
A "strict Arel" mode for ActiveRecord to prevent SQL injection vulnerabilities
Hello rubyonrails-core, I’ve been looking into possible changes to ActiveRecord / Arel to make it easier to write Rails applications that are free of SQL injection vulnerabilities, and in particular do so in a way that makes it easy for a code reviewer to verify that the app is safe from such bugs. The concern: ----------------- With the ActiveRecord API as is, it’s relatively easy to write
2011 Apr 18
12
Arel - clone bug (and fix), feature requests
Hi all, I''ve been playing around with Arel this week (actually outside of Rails) and found an issue with the clone implementation. I''ve added a patch and a testcase here: https://github.com/codders/arel/commit/660f706491ac012cb133554cffeaa6b9ae6046e9 and made a pull request against the rails/arel repo. I''ve also been playing around with support for ordering on
2011 May 05
9
[threadsafe] Arel ToSql visitor is not threadsafe
Hey, We hit a bug today because Arel::Visitors::ToSql is not threadsafe. Here is what is happening: Arel::Visitors::ENGINE_VISITORS is a cache of visitors instances. These instances are not inherently threadsafe because it contains state ''@last_column'', ''@connection'' that is shared between threads. The other variables ''@pool'',
2011 May 11
2
Issue with Arel::SelectManager and insert Method
Hello, Arel::SelectManager (arel 2.0.9) uses following statement to insert a new record: @engine.connection.insert im.to_sql, ''AREL'', primary_key_name, primary_key_value But in DatabaseStatements insert ist defined as: insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) Actually, Arel::SelectManager does not use the sequence name. This leads to issues
2012 Jan 03
1
Can Arel handle UPPER and LIKE condition?
Hello all, I''ve recently been on a project where somewhere needs using case insensitive search(using UPPER(name) LIKE '''') and LIKE condition, I want to use arel and don''t use the old style string concatenation, can arel handle this? But I check on arel documentation, doesn''t seems have any upper/like operator, and check on arel source, under
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
2010 Nov 16
6
rails 3.0.3 and visit_CoercibleString errors
From having no errors with 3.0.2 I now see lots of these errors when running my tests. undefined method `visit_CoercibleString'' for #<Arel::Visitors::MySQL: 0x000001074f4298> Anyone know what this is? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Jul 08
25
Prepared SQL statements
Dear all great developers. I wonder if there is any work being done or thoughts being shared regarding prepared SQL statements. Currently I am in heavy need of tuning SQL INSERTS that insert large (3MB) images into blobs. I am using rails 2.3.5 with postgres adapter and pg driver. Any information would be appreciated. Jarl -- You received this message because you are subscribed to the
2012 Apr 18
2
RoR - Search Forms with Checkboxes, display appropriate results
I have a form that allows me to search a hotel by city or name and by rating through radio buttons. It all works. However, my hotel model has_one :facility, this facility model is composed by several boolean fields (for example, roomservice:boolean restaurant:boolean and so on) The question is, I want to add checkbox fields for each facility I have and in the search form, when the user selects
2012 Dec 18
1
Arel limit Where if fields are present
I trying to create a select using Arel but I''m passing three parameters, I want to include the parameters only if they are different to nil or blank. Here is my method: def self.advsearch(summary_description, specialties, place) User.joins(:experience,:summary,:information) .where(Information.arel_table[:business].eq(false))
2012 Mar 13
2
[Arel]Building query, but can't get a proper output
I have the following code: advertisements_arel = Advertisement.order("advertisements.id DESC").arel @advertisements = (params[:website_id].present? ? advertisements_arel.where(:website_id => params[:website_id]) : advertisements_arel).to_a It returns a struct Arel::SelectManager::Row data But I''d like it to return an array of Advertisement objects (like it would
2009 May 09
4
Generating a "conditional time" variable
Hi everyone, Please forgive me if my question is simple and my code terrible, I'm new to R. I am not looking for a ready-made answer, but I would really appreciate it if someone could share conceptual hints for programming, or point me toward an R function/package that could speed up my processing time. Thanks a lot for your help! ## My dataframe includes the variables 'year',
2011 Feb 08
4
Remove ActiveRecord::Relation#& alias for 'merge' ? (or at least only reference and not use in AR)
Would the core team be open to the removal of the ''&'' alias for ActiveRecord::Relation#merge? The reason is that in Ruby the ''&'' operator refers to an intersection of two sets of data, not a merge. (within the context of the Array class) Recently Arel added support for SQL Set Operators: 2-0-stable:
2011 Jul 25
5
Arel quiz: complex queries with associations
I have a real-world application with some complex queries that I want to convert to Arel (as part of an upgrade to Rails 3.1). So that I can understand what I''m doing before I flail around in my real app, I wrote a little sample app (just the models) with some similar associations -- one table joined with itself and more tables that join to another table, so there are some queries that
2013 Feb 19
4
Float::INFINITY ranges in where() clause
This seems like such an obvious idea that I''m having trouble believing I''m the first to think of it. Why not take ranges containing Float::INFINITY and translate them to the appropriate greater than or less than comparisons? Example: class Person scope :voters, -> { where(born_on: (-Float::INFINITY..18.years.ago)) } end This would generate something along the lines of
2011 Mar 16
19
Uninitialized constant Files::Magick -still around
Hi there, I''m solving the problem about the plugin Magick. In my app in Gemfile I''ve follwoing: require ''rubygems'' require ''mongo'' require ''RMagick'' include Magick and in a model Files: class Files def self.save(upload) ... img = Magick::Image.read(''public/data/nature6.jpg'').first end end
2011 May 19
1
update_attributes updates data from second instance of nested form but not the first
Got a weird situation with an update put to a controller with a form with nested attributes. On the data below, I am updating data for both items (''0'' and ''1'') in rosters_attributes (in the example below I am updating the ''name'' attribute to a new value in both cases. What I am stuck on is that ''1'' gets its data updated,
2010 Jun 11
5
Issues creating tables in mysql tests
Hello, I''m a beginner, so any hints are appreciated; I''m still trying to find my way around Rails code. For a bug I''ve found I need to create a table called "values" so I added this: create_table :values do |t| t.integer :value end among the other table creations in activerecord/test/cases/migration_test.rb. Is that ok? But then, when I run the tests