Lots of code below, since it's usually the details that matter. Bit of a
long one, but I think it's generic enough to be a good one for the
archives.
Experimenting with how to extend ActiveRecord. So I picked a little
example project of an input scrubber. The purpose for the code is to
Albert,
thank you so much for this info. I have posted this quation twice and
not received a response.
Tried it and it is the solution.
It has been irritating me for a while, but I just haven't had time to
investigate it.
Many thanks
Tonypm
Greg Willits wrote:
Lots of code below, since it's usually the details that matter. Bit of a
long one, but I think it's generic enough to be a good one for the
archives.
OK, nevermind -- got it sorted out.
required this change:
def self.append_features(base_module)
On Apr 11, 7:57 am, Greg Willits rails-mailing-l...@andreas-s.net
wrote:
Greg Willits wrote:
Lots of code below, since it's usually the details that matter. Bit of a
long one, but I think it's generic enough to be a good one for the
archives.
OK, nevermind -- got it sorted out.
I made a bug in lighhouse to track this problems, I have some patches
for mysql and for the problem with the views in a related ticket
https://rails.lighthouseapp.com/projects/8994/tickets/2476-ascii-8bit-encoding-of-query-results-in-rails-232-and-ruby-191#ticket-2476-2
On Apr 6, 8:00 am,
What error do you get ?
Fred
sorry fred i'm unable to reproduce same error.
So i start with another one..
params[:album]=Bust a Move (12\ Remixes) - EP
TempRoyaltyReport.update_all(artist_name...@artist},album_name
=...@album},upc = #{params[:upc]},status = 'corrected',
On 8 Apr., 04:04, Mitchell Gould rails-mailing-l...@andreas-s.net
wrote:
David Knorr wrote:
On 6 Apr., 17:18, Mitchell Gould rails-mailing-l...@andreas-s.net
wrote:
ActiveSupport::TestCase
from
ActionController::TestCase
works like a charm.
Why don't they fix this?
What do
Frederick Cheung wrote:
On Apr 11, 7:57�am, Greg Willits rails-mailing-l...@andreas-s.net
wrote:
� base_module.before_create do |model|
� � model.attributes.each do |key,value|
� � � if model.class.attributes_to_scrub.include?(key.to_sym)
� � � � model.scrub_value(value) if !value.nil?
� �
one last update. i discovered that the problem is that i have windows
asp content from a legacy server that i use Net::HTTP to import into
my rails site. windows allows high ascii value codes (in this case
ascii 150/unicode 8211 resembles as dash, but isn't. it's a fancy
longer windows dash).
How can I get number of rows that was updated today?
Table: messages (id, title, message, updated_at)
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
Hi Fred, Andrew,
Thanks a lot! I did some searching on this. Mainly because it still
isnt working for me.
It still leads me back to the login page after failing the
before_filter :login_required callback on dashboard_controller.
Im using Rails 2.1.0 so I understand the option is still
On Apr 11, 11:43 am, Ram yourstruly.vi...@gmail.com wrote:
Im using Rails 2.1.0 so I understand the option is still
session_options[:session_domain] for me (as opposed to session_options
[:domain] for 2.2.0+)
By the way, ive tried setting ActionController::Base.session_options
I guessed I should be checking that but I really couldnt figure out
HOW to check them!
I use restful_authentication so where in the flow should i be raising
an exception and what should i be throwing up to debug?
Im actually pretty sure there're excess cookies hanging around.
Because when I go to
On Apr 11, 12:01 pm, Ram yourstruly.vi...@gmail.com wrote:
I guessed I should be checking that but I really couldnt figure out
HOW to check them!
Wasn't thinking of anything more sophisticated than checking in your
browser's preferences.
Fred
I use restful_authentication so where in the
On Apr 11, 11:42 am, Fresh Mix rails-mailing-l...@andreas-s.net
wrote:
How can I get number of rows that was updated today?
Table: messages (id, title, message, updated_at)
Decide on your precise definition of today (since midnight, last 24
hours etc.) and use ActiveRecord's count method.
Frederick Cheung wrote:
On Apr 11, 11:42�am, Fresh Mix rails-mailing-l...@andreas-s.net
wrote:
How can I get number of rows that was updated today?
Table: messages (id, title, message, updated_at)
Decide on your precise definition of today (since midnight, last 24
hours etc.) and use
:D duh...
ok i cleared the relevant cookies in Safari and its working now.
But Firefox is throwing me the InvalidAuthenticityToken error when i
try to login. any idea why?
On Apr 11, 4:09 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
On Apr 11, 12:01 pm, Ram
Hi
I install ruby and all gems and created one rails application .
When i started app its started but when mysql connection starts, server
autometiccaly stoped giving following error.
Please help me
= Booting WEBrick
= Rails 2.3.2 application starting on http://0.0.0.0:3000
= Call with
On Apr 11, 12:25 pm, Ram yourstruly.vi...@gmail.com wrote:
:D duh...
ok i cleared the relevant cookies in Safari and its working now.
But Firefox is throwing me the InvalidAuthenticityToken error when i
try to login. any idea why?
maybe it also had duff cookies? authenticity tokens are
:) I checked that the first time, of course. I know I came off a lil
dim last time but come on :D
I dumped all the cookies and authentication data and all other private
data twice and restarted FF and checked again to make sure nothings
hanging around and then cleared it again and I tried
On Apr 11, 12:40 pm, Ram yourstruly.vi...@gmail.com wrote:
:) I checked that the first time, of course. I know I came off a lil
dim last time but come on :D
I dumped all the cookies and authentication data and all other private
data twice and restarted FF and checked again to make sure
Bang on! :) Its working in production. Not working in dev. I can live
with that :). (i hope...)
Thanks again Fred!
On Apr 11, 5:23 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
On Apr 11, 12:40 pm, Ram yourstruly.vi...@gmail.com wrote:
:) I checked that the first time, of course. I
To get sub-domains working in development, I update my hosts file with
domains like x.test.com and y.test.com and test.com in my hosts file
all pointing to localhost and then do the various tests with the
cookie set on .test.com
Then you can access the sites on x.test.com:3000 etc
Andrew
Actually, on second thought, this could be a pain. I use FF with
Firebug to debug my JS. And also once in a while, check for browser
compatibility.
You think I can access and edit this 'list' FF might be working
off? :) kinda like editing /etc/hosts?
Or could there be a development domain that
Merb is going to be merged into Rails 3. Here's the blog post:
http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3
Obviously, I'd go with Rails ;-)
Best,
Jonathan
On Apr 10, 7:19 pm, meefs...@googlemail.com
meefs...@googlemail.com wrote:
Hi,
I'm going to create a new
Andrew,
Awesome! That did it.
Edited /etc/hosts as you suggested,
changed Subdomain_fu's tld_size for development to 1
restart server
boom!
Great stuff! learnt a lot! thanks a lot.. both of you..
On Apr 11, 5:41 pm, Ram yourstruly.vi...@gmail.com wrote:
Actually, on second thought, this could
Hi All,
I am inserting data from one table to another by using following method
@data=RoyaltyReportFiles.find_by_sql(insert into royalty_reports
(artist_name, album_name) select artist_name, album_name from
temp_royalty_reports where id=328417)
it saves the data into royalty_reports table but
Salil Gaikwad wrote:
I am inserting data from one table to another by using following method
@data=RoyaltyReportFiles.find_by_sql(insert into royalty_reports
(artist_name, album_name) select artist_name, album_name from
temp_royalty_reports where id=328417)
Use either count_by_sql(),
Use either count_by_sql(), execute(), or the method higher than
execute() whose
name I forget...
Also, AR can insert one record for you very easily...
Actually i'm trying to insert multiple data from one table to another
table but i take only one data here for example.
i try
Hi everyone.
I have a quick question. I'm wondering if there's a Rails plugin along
the lines of foreign_key_migrations, but for check constraints. (I
found mig-constraints already, but that's apparently not maintained and
doesn't seem to work.) Basically, I'd like to be able to do something
On Apr 11, 1:47 pm, Ram yourstruly.vi...@gmail.com wrote:
Andrew,
Awesome! That did it.
Edited /etc/hosts as you suggested,
changed Subdomain_fu's tld_size for development to 1
restart server
boom!
I just about always have domains in /etc/hosts to mirror the real
ones, ie if the app was
If anybody is interesed in new technologies, you'll love this new
language called Falcon [1], which has been open sourced ago little
time.
Falcon is a scripting engine ready to empower mission-critical
multithreaded applications. It provides six integrated programming
paradigms: procedural,
On Apr 11, 2:30 pm, Salil Gaikwad rails-mailing-l...@andreas-s.net
wrote:
Hi All,
I am inserting data from one table to another by using following method
@data=RoyaltyReportFiles.find_by_sql(insert into royalty_reports
(artist_name, album_name) select artist_name, album_name from
I just about always have domains in /etc/hosts to mirror the real
ones, ie if the app was deployed at www.example.com
orders.example.com I'd have www.example.local orders.example.local.
I like keeping my development environment close to the production one.
Fred
Agreed, I just wish I
Thanks for the help Philip. -- clients and contractor get their own
passwords for access to a project's home page. In the project's home
page, a few things can be done by both clients and contractors and
other things only one or the other party can do. And these 'things (I
am terribly sorry to
named_scope :recent, lambda { {:conditions = ['updated_at ?',
24.hours.ago]} }
On Apr 11, 7:25 pm, Fresh Mix rails-mailing-l...@andreas-s.net
wrote:
Frederick Cheung wrote:
On Apr 11, 11:42 am, Fresh Mix rails-mailing-l...@andreas-s.net
wrote:
How can I get number of rows that was
The problem here is that update_all doesn't actually sanitize the
value passed to the 'updates' parameter. Your particular example will
work if you change just surround the #...@album} in single quotes, but
that's obviously not going to address the broader problem. Rather,
you'll need to do
Hmm, hope you can post up more code, even from your controller as
well.
I think that instead of replacing the entire select tag, you can
simply replace its contents. Firstly, give the select tag an id so
that in your RJS, you can replace_html with options_for_select or
whatever function you
On Apr 11, 5:16 pm, pharrington xenogene...@gmail.com wrote:
The problem here is that update_all doesn't actually sanitize the
value passed to the 'updates' parameter.
It can do if you give it a chance, eg TempRoyaltyReport.update_all
([artist_name=?, @artist_name]) or
I would suggest not creating two tables. This falls into the domain of
access control and I would recommend looking at Acl9
http://github.com/be9/acl9/tree/master
As for information pertaining only to clients or contractors, you
could use a single User model and add contact details to it. Or you
http://stonean.com/projects/lockdown does roles without loading from
the DB on every access. I like how the specification of all
permissions and groups are in one place.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Don't know why i didn't know this. Thanks!
On Apr 11, 12:52 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
On Apr 11, 5:16 pm, pharrington xenogene...@gmail.com wrote:
The problem here is that update_all doesn't actually sanitize the
value passed to the 'updates' parameter.
It
assert_no_rjs_ now negates all the JavaScript assertions listed here:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/49fd7c9b9107d577
And assert_rjs_ now works in RSpec:
it 'should use Ajax to replace person 45' do
xhr :get, :replace_person, :id = 45
OK, I used the ID of the select and did a replace:
RJS:
page[:showcontact].hide
page[:contactlist].show
page.insert_html :bottom,'contactlist', :partial = 'ajaxAddToMop', :locals
= {:contact = @contact }
page[:contact_id].replace :partial = updateContactList, :locals =
{:contacts = @contacts,
In my app I've started to get a 500 error whenever trying to post to a
create method
/!\ FAILSAFE /!\ Sat Apr 11 18:42:28 +0100 2009
Status: 500 Internal Server Error
string not matched
According to the log it doesn't even get as far as the POST
anyone know what might be causing this?
I
Postgresql v6.3.8.1 works with Ruby 1.9.1p0 and Rails 2.3.2 - my guess
is the problem is with either the driver or the database itself.
Can you tell what the actual encoding is of the database? How about
setting the default? MySQL refers to this as the CHARACTER SET. For
example, to set utf8
There's still something weird going on - you shouldn't have to run the
freeze task as root...
What exactly is incomplete when you run it as a regular user?
--Matt Jones
On Apr 10, 4:34 pm, Olaf S. rails-mailing-l...@andreas-s.net
wrote:
Thank you very much for your help. It was a very stupid
Role-based auth is one possibility, but single-table inheritance is
another. It's very dependent on how your app handles permissions; if a
user can have a mixture of different permissons, role-based is better.
On the other hand, if your app has clearly delimited user categories
(ie Employee vs.
Are you using Rack? It looks like you might be experiencing this error
(or something very similar):
http://www.elctech.com/snippets/-solved-500-internal-server-error-string-not-matched
On Apr 11, 10:47 am, Gavin ga...@thinkersplayground.com wrote:
In my app I've started to get a 500 error
You can shorten this part up by using Tag.find_or_create_by_name, one
of the dynamic finder methods.
And I'd add a generic warning to NEVER use #{} interpolation directly
in anything you're feeding to an AR conditions parameter, unless you
want to relearn the lesson of little Bobby Tables...
The
right - somewhat slow on the uptake
On Apr 11, 8:28 am, ruby.freeman ruby.free...@gmail.com wrote:
Postgresql v6.3.8.1 works with Ruby 1.9.1p0 and Rails 2.3.2 - my guess
is the problem is with either the driver or the database itself.
Problem is not with database. As I said above, when I
In my app I've started to get a 500 error whenever trying to post to a
create method
/!\ FAILSAFE /!\ Sat Apr 11 18:42:28 +0100 2009
Status: 500 Internal Server Error
string not matched
According to the log it doesn't even get as far as the POST
anyone know what might be causing this?
I
Thanks for that Jason
It looks like the same issue - and I certainly get the 500 error when
I paste the ?b%5Ba%5D=b%5Ba%5Dc= query in the address bar.
I'm not using WidgeEditor though
...
I changed my model name (and controller etc.) from item to print and
that seems to have solved it!
I
ruby.freeman have you checked my fork of mysql-ruby? and the ticket
in lighthouse?
I think this will resolve your problem.
Or have you checked it out and still got problems?
On Apr 11, 1:28 pm, ruby.freeman ruby.free...@gmail.com wrote:
Postgresql v6.3.8.1 works with Ruby 1.9.1p0 and Rails
Hello,
I want to create a screen similar to the delicious one, where you can
assign tags dynamically
to the bookmarks, but I don't have the tags neither the bookmark
created before the submit, and
all approaches that i tried resulted in the following error:
Cannot associate new records
On Apr 11, 10:10 pm, Felipe Lopes felipelope...@gmail.com wrote:
all approaches that i tried resulted in the following error:
Cannot associate new records through 'Bookmark#taggings' on '#'.
Both records must have an id in order to create the has_many :through
record associating them.
Ok this is weird, I have full CRUD working for my contacts table all
doing ajax inline in my form. the odd one is that my delete funtion
uses the same partial as the one above and when I do the rjs for the
update on the select it DOES give me the Prompt to select User.
Delete is the only one
On Sat, Apr 11, 2009 at 1:51 PM, Hector Gomez hector...@gmail.com wrote:
ruby.freeman have you checked my fork of mysql-ruby? and the ticket
in lighthouse?
I think this will resolve your problem.
Or have you checked it out and still got problems?
On Apr 11, 1:28 pm, ruby.freeman
Hi, I guess my question is rather simple, is it possible to upload to S3
without hitting the local server using Rails? If so, are there any
tutorials or similar things around?
PS: and what about being able to display a progress bar at the same
time? I know I'm pushing it, but I also know there's
Nope, it is not.
S3 receives files by HTTP PUT requests and browsers can't do PUTs.
Worse, to do something like that you would have to give your user
your api keys, which isn't really a good idea.
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
Hi all, I am new to Ruby on Rails and struggling to finish my class
project.
I have problem with unit testing, if any body could help.
I have a function that updates 'feeds' table. It has a columns: id,
feeddata, lastupdate. feedupdate.
I am building a small/medium sized ecomm site that will be managed
through a little Rails CMS I have built. I've built a few CMSs in PHP
in the past... In those projects the CMS would always live in its own
directory and the public site in its own. Of course the two would
share the same DB, but
On Apr 11, 11:43 pm, Ps_gem Sh_gem rails-mailing-l...@andreas-s.net
wrote:
My 'updatefeed' function is working on application well. But my test
doesn't show the updated 'lastupdated' column date but only the value in
fixture. Shouldn't the fixture value be updated on execution and after
I have not contacted upstream (tmtm) but he is working on a pure ruby
adapter called ruby-mysql (is encoding aware, etc) it has a compat
layer but is
not functional now.
I have made a gem of my fork hectoregm-mysql-ruby that you
use to make tests, but I will try to get this changes merge
I am trying to establish a connection to oracle through ruby-oci8 with
the intent on using ActiveRecord.
I have Oracle instant-client installed in the usual system location.
I have these gems installed in my user space:
activerecord (2.3.2)
activerecord-oracle_enhanced-adapter (1.2.0)
I figured out (or rather the helpful peeps at aptana helped me figure it
out)
ENV['PATH'] has to be set to include /opt/local/bin (for some reason on
aptana it doesn't point to that by default). Once I set that everything
worked.
--
Posted via http://www.ruby-forum.com/.
Hi Steve,
If you don't mind using Flex/Flash to do the client side UI, you can
upload directly to S3 with a progress bar using a POST. The api keys
get encrypted so no worries about loosing them.
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1092
Good luck,
Michael
On
Folks,
I seem to be missing something basic here.
I am trying to call a function from my application layout that will
return me a hash of the roles for the user currently signed in. Here
is the simplified code I have in ApplicationHelper module
class Array
def to_h
should be update rails my approach?
should it start working after an update?
--~--~-~--~~~---~--~~
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
Ps_gem Sh_gem wrote:
Hi all, I am new to Ruby on Rails and struggling to finish my class
project.
I have problem with unit testing, if any body could help.
Professor Phlip will now dispense some tips.
I have a function that updates 'feeds' table. It has a columns: id,
feeddata,
Solved. I just built up my own Ruby and RubyGems environment and all is
well. Thanks for the tips.
R
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
I am trying to generate a static archive (zip) as follows:
Model has following method
def generate_archive
dir = /tmp/#{self.id}
title = self.title.gsub(/^\s+/, '').gsub(/\s+$/, '').gsub(/\s+/,
'-')
id = self.id
host = #{RAILS_ENV}_HOST.upcase.constantize
url = url_for
72 matches
Mail list logo