Displaying 20 results from an estimated 10000 matches similar to: "ActiveRecord: SQL IN operator"
2009 Nov 11
4
Schema dump does not reflect column size limit
Hi,
Everything is in the title.
With Rails 2.3.4 and MySQL 5.0.41:
If have a table like this:
+----------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL |
2008 Mar 07
3
timestamp help
I am trying to figure out if a time stamp in my database is older then
a month so that way my controller will only collect the one''s that are
newer. So far I have
@notes = @customer.notes.find(:all, :conditions => {:level =>
[''notice'', ''warning'', ''error'']}, :order => ''created_at DESC'')
But I do not want it
2007 Mar 13
6
Easy Date question - newb
All I want to do is find the objects that were created today under the
''created_on'' column. I''ve tried many ways, here is one example using
the chronic gem.
@products = Product.find_all_by_created_on(Chronic.parse(''today''))
I must be missing something right in front of me .... Thanks for any
help.
2008 Nov 17
7
super global dummy method for gettext + rails 2.2
Hi,
since rails 2.2 doesn''t work with gettext anymore I decided to use a
gettext dummy method until the gettext team relases a working version
for rails 2.2. My application doesn''t need any i18n support right now
and this way i figured it would be very easy to integrate gettext
later. Just setup the plugin and go.
So I need a method called _ which is available in alle models,
2009 Dec 03
2
Dynamic Paths
Hey there,
I''m in the muck of a major rails project, and need a bit of advice. Google
isn''t much help in this case, so I came here.
I''m trying to set up a URL structure as follows:
url.com/username/blog/post_id
where the user has_many posts and the post belongs_to user. I''m using the
friendly_id plugin to enable easy lookup with the user''s username,
2007 Feb 27
14
Stop browser from "form filling" fields.
Hi all,
I have a user login form which the browser keeps populating because of
its form fill feature. So when anyone goes to log in it shows the
previous login''s username and password. How can I stop the browser
from populating a text field?
Thanks in advance.
Cheers,
Diego
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to
2009 Jan 09
2
Confused about to_xml() in ActiveRecord::Base subclass
Since all my efforts to control how to_xml() is formatting dates has
failed, I''m now considering writing my own to_xml(). However, from
the limited examples I''ve found, I just don''t understand how to
actually reference the columns for the records in my record set.
Here''s a simplified view of my ActiveRecord object:
class Errors < ActiveRecord::Base
2007 Oct 19
14
Agile Web Development Book, need a bit of help
I''m working my way through the book Agile Web Development with Rails,
and I am in the section where the book has me creating a display_cart
method and the associated view. When I copied the code from the book
into the view, it threw this error. If anyone could give me some hints
where I should be looking I''d appreciate it.
NoMethodError in Store#display_cart
Showing
2009 Oct 13
3
Site map
Hi All...
I am using generate_sitemap plugin to generate sitemap. It goes very
well and creates sitemap as well. My problem is I want some links that
are coming from vender/plugins. Can any one tell me how to get those
links???
Thanks all...
--
Posted via http://www.ruby-forum.com/.
2010 Jan 31
6
Action path - syntax error, unexpected tIDENTIFIER, expecting ')'
I have a user controller with login as action.
When I access the index.html.erb file via application.layout file. I get a
error on the login link on the index.html.erb page. I think I am having
dfifficulty in setting up path to an action or even understanding how to set
REST path properly. Can someone please help me.
Here is the error on the home page:
2010 Aug 13
11
Link to remote and the equivalent in Rails 3
Hi
WOW! Is Rails 3 another interesting learning curve. Just when I think
I have a general working knowledge of Rails 2 ... things change.
I''m trying to replicate the following in Rails 3:
<%= link_to_remote image_tag("creditcard.png", :border => 0), :url =>
{:action => :make_payment, :type => "Credit", :id =>
@appt.id },
2008 Aug 26
5
undefined method
I''m trying to pass a method to another object/method as a variable.
Example one, login 1 works just fine.
def login1
@driver.Login(username, password)
end
However, if I try to pass "Login" to the driver as an argument
(example two Login 2), I get "undefined method `command_string'' for
#<SOAP::RPC::Driver:0x316dc28>"
"Login" is a legit
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
When I run my functional tests, they throw an error with the following
message:
ActionView::TemplateError: Missing template /_captcha.erb in view path
app/views:test/vendor/plugins/brain_buster/views/brain_busters
On line #23 of app/views/contacts/_form.html.erb
20: <%= f.label :message %><br />
21: <%= f.text_area :message %>
22:
2006 May 04
7
ActiveRecord and SQL Server
Hi all,
I am exploring using RoR for a new project but have run into a
problem with ActiveRecord and SQL Server''s timestamp datatype.
We have a NOT NULL timestamp column in a table and ActiveRecord keeps
trying to update it, which promptly causes it to blow up. I have
tried making the value NULL for insert and update in the model, but
SQL Server doesn''t like that
2016 Feb 23
6
Laptop SCSI capability supported by CentOS 7
I'm looking for a well-supported ExpressCard or PCMCIA/CardBus SCSI card
that can do at least FastSCSI (Narrow, Wide not necessary) that is
supported by CentOS 7. I have an Adaptec SlimSCSI 1460D, but it doesn't
seem to be supported (it's previously supported by the aha152x driver).
Any ideas are welcomed, other than 'just use a desktop.' I am not sure
a USB or Firewire
2008 Aug 28
2
1 or true in TINYINT(1) column?
Hello, there is a table that has a column TINYINT(1) called status.
Through mysql console I see its value as 1 (when is true) but if I do
this in Rails console:
Mytable.status
=> true
give me "true" rather "1".
How could I change 1 to true using some method?
Or true to 1?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2009 Jan 28
2
open_uri failure on good uri.
I am trying to open a URI using doc = Nokogiri::HTML(open(url)). I get
the following error:
URI::InvalidURIError: bad URI(is not URI?):
http://www.mauipropertytax.com/Datalets.asp?mnu=PSearch&submnu=Profile&pin=390350950000&tp=2&cp=1&State=1|1|*&item=1
from /usr/local/ruby/lib/ruby/1.8/uri/common.rb:436:in `split''
from
2007 Nov 12
7
schema_info always wants to be 3, even when set to 7
Hi all,
I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5
on Windows XP SP2 and Ruby 1.8.6
I have seven migrations. If I run them with an empty database, it
runs the first three, then halts. When I look in schema_info, the
version is 3.
If I run db:migrate VERSION=7, then it runs through the remaining 4
migrations, and the version is 7 in the DB.
2007 Dec 12
6
Add a month to a Date object
Howdy all,
This may be the dumbest question in the world, but how can you "add
one month" to a Date object? I can''t just add 30 days, because months
have varying lengths.
Any help would be much appreciated...
Thanks!
-Neal
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Apr 21
2
Date Time format in Ruby
Can anyone give a suggestion so that i can able to format the date as
like this 3th - 5th June 2009
--
Posted via http://www.ruby-forum.com/.