Displaying 20 results from an estimated 8000 matches similar to: "sqlite sets a new model''s id to 0 after a save"
2006 Feb 17
7
Create and then show
I am attempting to redirect to the show method after creating a new
object. So, for example, once a new post is created the user is
presented with the new post in a show view. The problem is I can''t get
the correct <at> post.id to send to the show method. Rails always
returns 0 for this value.
Here''s what I have so far:
class ContentController < ApplicationController
2006 Jul 09
8
Can the has_many create() method return an ID?
Hi all,
I have a has_many relationship, Cookbook :has_many Recipes
If I want to create a new recipe in my cookbook I do:
cookbook.recipes.create(data)
It would be nice if I could then easily get the id of the new recipe,
but the create() method doesn''t seem to return anything. Any ideas how?
Thanks in advance!
Cameron
--
Posted via http://www.ruby-forum.com/.
2006 Mar 01
2
SQLite in small production environment
I apologize if this has been asked before, but couldn''t search the
forum-mailing-list bridge. It seems the search feature is currently
disabled.
I wanted to know if SQLite will work for my company in a production environment.
My company''s current website gets about 15,000 hits/month. The most
hits it ever got in a day was about 1,500.
I will be deploying my application on a
2006 Feb 28
6
How To Validate Boolean Form Field
Hello all.
I''ve got the following in my model:
class Individual < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :street, :city,
:state, :zip
validates_acceptance_of :AZ_resident, :message => "You must be an
Arizona resident."
end
The AZ_resident field is present and defined as boolean (PostgreSQL
8.1), but validation will not occur.
2006 Mar 03
7
Meta Programming Help
I have the following two methods:
def ProductFile::find_images(mode, prod_id)
# convert to symbol in case it is not (most commonly it may be a String)
mode = mode.to_sym
case mode
when :all, :first
ProductFile::find(mode, :conditions => ["product_id = ? AND
file_type LIKE ?", prod_id, "image%"])
end
end
def ProductFile::find_documents(mode,
2008 Apr 12
12
sqlite3.dll problem
Hi I''m triying to begin developing in ruby on rails, and I''ve instaled
all the components but there is a problem with the file sqlite3.dll.
When I try to execute my first example in my web browser apears an alert
that says sqlite3.dll is not found.
I''m working on windows XP with firefox and the server is WEBrick.
If someone knows how can I resolve the problem please
2006 Mar 03
5
avoiding nil object error?
I''m a total Rails newbie and i''ve been struggling for hours today
with one (prolly very silly) problem:
I have a table portfolios that has many images:
class Portfolio < ActiveRecord::Base
has_many :images
end
class Image < ActiveRecord::Base
belongs_to :portfolios
end
In the controller i define a list of active portfolios:
@active_portfolios =
2006 Aug 02
1
unable to "require" installed gems
Hi,
I''ve installed sqlite3 (via the instructions at
http://wiki.rubyonrails.org/rails/pages/HowtoUseSQLite), and all went
well
OSX 10.4.7
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.6.0]
and sqlite3.rb is in
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib
but I can''t <require ''sqlite3''>
caw$ irb
irb(main):001:0> require
2006 Mar 13
3
unit tests executed for every page load ?
After I installed the very sweet file_column plugin I get strange output
on my html pages. At the very end I always get something like this:
"Loaded suite dispatch.cgi Started Finished in 0.000218 seconds. 0
tests, 0 assertions, 0 failures, 0 errors "
Seems like there is executed a non existent test suite for every page
load. Can anybody help me find the lines that force this
2006 Mar 02
2
How to get mime extension with file_column
Is there a way to get the MIME extension of a file_column field?
Here''s what I want to do (look for comment in before_save method):
class ProductFile < ActiveRecord::Base
belongs_to :product
file_column :file_name
def before_save
self.file_type = # something that returns the MIME type (e.g. image/jpeg)
end
end
TIA
2006 Mar 02
17
can''t get rails to connect to mySQL - HELP!!!!!!!!!
Sorry, but this is really NOT as easy as the tutorials/books make out.
I''m really struggling at the first hurdle here. And while I''m not a
programmer by design I do know my way around most stuff. And if I can''t
get this to work I suspect more people will have the same issues. There
seems to be too many variables to address.
I have winXP, I have ruby and rails all
2008 Apr 08
7
SQLite3 error
I am trying to install SQLite3 on my Rails app but I keep getting this
error:
./sqlite3.dll: 127: The specified procedure could not be found. -
Init_sqlite3 (LoadError)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2006 Feb 27
3
Newbie Question
Hi! I just ran the first few Rails tutorials and I''m really impressed
at how quickly I was able to get something up and running.
I''m slowly emerging from the stone ages, and leaving my powerbuilder
behind ? yes, I know, keep the snickering to a minimum please! I
started into J2EE/STRUTS, but was quickly frustrated by how long it
would take to code anything but relatively
2006 Jan 20
1
sqlite3
ok... so I''m trying to get sqlite3 up and running on my app but i keep
hitting a wall when i try to install the gem... I''ve got all the right
bits a pieces installed (i can run sqlite from the console and create
databases and such) but gems keeps telling me that it can access the
ruby header file. but, i can can find this file in spotlight not
problems (and no there is nothing
2005 Jul 20
6
Wxruby2 gemspec
Hi
A gemspec for installation of wxuby-swig via rubygems. It assumes the
end-users will compile the pre-swigged .cpp files & that that the main
require file will be wx.rb (as per Kevin''s suggestion). runrake.rb is
just a helper script that runs rake correctly within the rubygems
installation process.
# to build the gem
gem build wxruby2.gemspec
# to build & install the
2006 May 03
2
How do you use the ''vendor'' directory with 3rd party libraries?
Hi,
I''m wondering how to use the ''vendor'' directory in a Rails app. I
know that you can put plugins and engines into the ''vendor/plugins''
directory and that svn:externals can be used for that, but I was
wondering how & where I put a 3rd party library? My specific case is
the pdf-writer code, which I''d rather have inside my app than as a
2006 Mar 01
15
Is there a perl equivalent of .= in ruby/rails??
I want to make a for loop that concats strings onto a variable:
html .= var1 + "this is a test" + whatever
What is the syntax that does this in ruby/rails?
Also, is there a ''print'' method in ruby? Because when I try to use
render_text it will only let me use this once.
--
Posted via http://www.ruby-forum.com/.
2016 Oct 20
2
queue_log/cel sqlite
hi,
is it possible log cel/queue_log to sqlite?
via odbc?
any experience?
marek
2008 Nov 12
1
gem ruby-sqlite3 install error
i am tryin' to install ruby-sqlite3 via gem, but it keeps givin' me this
output:
mathilda ~ # gem install sqlite3-ruby
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install sqlite3-ruby
checking for fdatasync() in -lrt... no
checking for sqlite3.h... no
make
make: *** No
2005 May 30
2
deadlock [BUG] Segmentation fault
I''m getting this error suddenly:
http://rails:3000/ -> /project/list
deadlock 0x4081419c: run:-/usr/lib/ruby/1.8/timeout.rb:42: [BUG]
Segmentation fault
Running rails 0.12.1 and tracks. Both 1.02a and the HEAD.
Could this be caused by the sqlite3 driver?
OS is Debian/Xen.
Nicholas