[Rails] Re: Rails 3 and saving decimal values from a form

2011-05-15 Thread Fernando Perez
What would cause this? The database has the correct settings for the column and I can create a correct record using the rails console. The only column type that works is decimal is that your case? And gimme a link to your app so that I'll make it crash by inputting decimal values that have a

[Rails] Re: Which install method for rvm on production server?

2011-05-06 Thread Fernando Perez
Fernando Perez wrote in post #981446: All in all, even if I had to endure a bit of trial and error, I really like the way rvm works and keeps things confined. If one day my ruby and/or gems go South I can simply rm -r ~/.rvm and everything goes away so that I can start a fresh install

[Rails] Re: Which install method for rvm on production server?

2011-05-06 Thread Fernando Perez
rvm sudo prompts me for my password, so I guess under the hood it's triggering sudo, so why that it now have the proper permissions over /opt??? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: Which install method for rvm on production server?

2011-05-06 Thread Fernando Perez
I had no other choice to change the permissions on /opt/nginx to the group in charge of the webapp stuff. -- 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 group, send email to

[Rails] Re: Ruby On Rails 3 and Webrick

2011-04-17 Thread Fernando Perez
/Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/ mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError) Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/ mysql2.bundle

[Rails] Re: Debugger breakpoint ignored in Rails 3 test

2011-04-16 Thread Fernando Perez
Do you have group :development, :test do gem 'ruby-debug' end in your Gemfile? Sorta' I actually have: group :development, :test do gem 'ruby-debug19' end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: Debugger breakpoint ignored in Rails 3 test

2011-04-14 Thread Fernando Perez
Are you using a ruby command to run the test, ie ruby options some_file.rb? If so then use rdebug rather than ruby. Indeed Colin, I just tried with rdebug and now the breakpoints are honored. But it's a bit painful to use on a single test as the debugger stops once when it hits the require

[Rails] Debugger breakpoint ignored in Rails 3 test

2011-04-13 Thread Fernando Perez
For some reason my debugger breakpoint is ignored when I run a single test, but the debugger works in the development environment. Is there anything that I may have missed transitioning from 2.x to 3.x to make the debugger work during tests? -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Rich text editor?

2011-04-12 Thread Fernando Perez
TinyMCE is shit! Oh and if you dare use it, remember to activate the option to not convert special characters to html entities or your data is doomed. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Ruby on Rails integration with Red5 Chat

2011-03-03 Thread Fernando Perez
I used to have a videochat app on my website. People would register from within the Rails app, then the Red5 server would simply access the database to check for credentials. The rails part was fun, the Red5/java part... less fun. -- http://digiprof.tv -- Posted via

[Rails] Re: group() and PostgreSQL strange behavior

2011-03-03 Thread Fernando Perez
I tried, and received the same result: User.group(:first_name) The thing is, we group for a reason. So PostgreSQL is expecting that reason to appear, e.g: count(), sum(), etc. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] How to create a method such as: @user.travels.register(.)

2011-03-02 Thread Fernando Perez
Hi, In order to trim my controllers down and keep the code in the correct place, I am trying to refactor: @user.travels.create(:name = ..., :date = ..., :ip = request, etc) to: @user.travels.register(params, request) So my questions are: 1) is create() an instance method of Travel? I

[Rails] Re: How to create a method such as: @user.travels.register(.)

2011-03-02 Thread Fernando Perez
Thank you Frederick. I now know where and what to look for. -- 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 group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe

[Rails] group() and PostgreSQL strange behavior

2011-03-02 Thread Fernando Perez
Here is a simple request: Visit.group(user_id) And I get: PGError: ERROR: column visits.id must appear in the GROUP BY clause or be used in an aggregate function If I add visits.id to the group by clause, then it asks me to add another column, then another, then another. Basically I have to

[Rails] Re: group() and PostgreSQL strange behavior

2011-03-02 Thread Fernando Perez
Eureka! The docs are incomplete. I obviously need to add a count, sum, etc method for the grouping to make sense. -- 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 group, send

[Rails] Re: autotest not doing anything

2011-03-02 Thread Fernando Perez
Forget about autotest. It looks cool in the screencasts, but it quickly becomes annoying. -- 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 group, send email to

[Rails] [Rails3] Visitor is a reserved word?

2011-02-16 Thread Fernando Perez
I cannot do the following on my freshly created and immaculate app: $ rails g model Visitor The name 'Visitor' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again. I checked the rails wiki, but Visitor doesn't appear

[Rails] Re: [Rails3] Visitor is a reserved word?

2011-02-16 Thread Fernando Perez
My bad I just realized that my app is called visitor and Rails3 uses this name in various places. I don't like this new convention, if I want to change the name of my app I need to fix it in a few places. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Re: [Rails3] Whitelist Rails 3 aggressive sanitizer

2011-02-14 Thread Fernando Perez
Why is your application escaping the image tag? Because I do something such as: %= link_to #{image_tag(cart.png)} Cart, cart_url % So really the image_tag is inside a string, hence its sanitization. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Rails 3: I18n.locale not set to I18n.default_locale in production

2011-02-14 Thread Fernando Perez
rainerfrey wrote in post #935581: This has most likely to do with a problem which was posted to the core mailing list here: http://groups.google.com/group/rubyonrails-core/browse_thread/thread/1fe3e88f9fe73177/ The culprit seems to be: I18n.locale is set to some value, if models include a

[Rails] [Rails3] Confused by RJS vs Unbstrusive jQuery and such

2011-02-14 Thread Fernando Perez
I am developing a small blog with a cool feature to edit articles in the page through ajax. So I made my Raisl3 app load jQuery and opened AWDWR3 to learn whether anything had changed. So I create an RJS template: edit.js.rjs with: page.replace_html(article_#{@article.id},

[Rails] Re: [Rails3] Confused by RJS vs Unbstrusive jQuery and such

2011-02-14 Thread Fernando Perez
$(#article_%= @article.id %).update(%= render('admin/articles/form') %); My bad this line of code was a mix of Prototype and jQuery, here is the correct line of code which works! $(#article_%= @article.id %).html(%=render('admin/articles/form') %); I think I'm starting to find the light.

[Rails] Re: [Rails3] Confused by RJS vs Unbstrusive jQuery and such

2011-02-14 Thread Fernando Perez
$(#article_%= @article.id %).html(%= render('admin/articles/form') %); Actually this does not work. But If I do: $(#article_%= @article.id %).html(hello world); It works as expected. What's wrong? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: [Rails3] Confused by RJS vs Unbstrusive jQuery and such

2011-02-14 Thread Fernando Perez
Wow there is some Rails magic going on. If I replace the code in _form.html.erb by simple Hellow world, now the div gets correctly updated. Is Rails filtering, escaping, or preventing a form from updating my div through ajax? -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Re: Re: [Rails3] Confused by RJS vs Unbstrusive jQuery and such

2011-02-14 Thread Fernando Perez
Phil Crissman wrote in post #981622: This is just a guess: try $(#article_%= @article.id %).html(%= escape_javascript( render('admin/articles/form') ) %); Phil YES!!! Thank you very much Phil! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
I read a lot of stuff about rvm so I want to use it on my production server, but which installation method should I use? site-wide? I use a system wide deployment ( http://rvm.beginrescueend.com/deployment/best-practices/ ) Fred Ok, so on my FreeBSD box, the site system wide install

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
$ sudo passenger-install-nginx-module which will install in /opt/nginx. Should I use a non sudo location or stick with sudo for nginx? Argh! With rvm's normal installation I cannot use sudo. Good, now I'm stuck. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
Jim ruther Nill wrote in post #981401: use rvmsudo. Thanks! So far so good. Just a last question. I have my own script to remotely update and maintain my apps (I don't use capistrano and don't intend to do so). But when I want to remotely run bundle install it can't find it. It's certainly

[Rails] Re: GemFile error + General Help?

2011-02-13 Thread Fernando Perez
As a side note question, should Gemfile.lock be added to the repository and uploaded to the production server? -- 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 group, send email

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
Adding a .rvmrc to the project did not help, neither did rvm 1.9.2 exec bundle install. -- 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 group, send email to

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
Ha! Using ssh and gem env, I discovered that rvm was not loaded. So it's definitely a bash_profile VS profile VS etc evil issue. God that's painful. So when in a script I use: ssh -t blabla 'bundle install' what kind of shell is created? Which files are loaded? Why can't I get the same

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
This separation interactive/non-interactive is stupid to me, and unnecessarily complicates things. Is that related to bash? What if I use a different shell? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
Argh! I have sourced .profile from with .bashrc but it still doesn't work. It seems that the following line is key and is not being loaded: [[ -s $HOME/.rvm/scripts/rvm ]] . $HOME/.rvm/scripts/rvm -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
I found a solution! In the script, do something such as: source ~/.rvm/scripts/rvm bundle install And it will work. -- 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 group, send

[Rails] Re: Which install method for rvm on production server?

2011-02-13 Thread Fernando Perez
All in all, even if I had to endure a bit of trial and error, I really like the way rvm works and keeps things confined. If one day my ruby and/or gems go South I can simply rm -r ~/.rvm and everything goes away so that I can start a fresh install in a breeze. -- Posted via

[Rails] [Rails3] Whitelist Rails 3 aggressive sanitizer

2011-02-13 Thread Fernando Perez
I have the following code: %= link_to(image_tag(...)) % The problem is that Rails sanitizes the images so it gets rendered as: lt;img src=... /gt; I could use html_safe, but that's painful and makes my code less readable. In Rails2 I could declare a whitelist such as:

[Rails] Re: [Rails3] Whitelist Rails 3 aggressive sanitizer

2011-02-13 Thread Fernando Perez
Agile Web development With Rails 3 p.91 awkwardly addresses the issue by using strip_tags() and skipping the explanation about how to let safe tags through. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] Re: Rails 3 working with webrick and SSL

2011-02-11 Thread Fernando Perez
If I recall correctly, webrick doesn't support SSL. Mongrel neither. You'll have to use Apache or Nginx for that. Yes, SSL dev for Rails is a bit painful. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails:

[Rails] [Rails3] How to define RAILS_ENV for rake?

2011-02-07 Thread Fernando Perez
With Rails3, it is no longer possible (well soon to be deprecated) to do: $ RAILS_ENV=test rake db:migrate So what's the new way of doing it? -- 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

[Rails] Re: invalid multibyte character error

2011-02-07 Thread Fernando Perez
Fernando Perez wrote in post #923012: When I try to use multibyte characters in my rails controller I get an invalid multibyte characters error (rails_app/app/controllers/admin_controller.rb:6: invalid multibyte char (US-ASCII)). After I start the WEBrick server and go to http://localhost

[Rails] Re: invalid multibyte character error

2011-02-07 Thread Fernando Perez
I see this: $ ruby -e 'puts Encoding.find(locale)' ASCII-8BIT How to set the proper locale/encoding? -- 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 group, send email to

[Rails] Re: invalid multibyte character error

2011-02-07 Thread Fernando Perez
From that url: http://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed.html Ruby 1.9 can now properly read source code files encoded in formats other than ASCII, as long as you declare it: # coding: utf-8 Don't tell me I have to put that in every file of my apps? -- Posted via

[Rails] Re: Custom form error messages

2011-02-07 Thread Fernando Perez
I have a problem with my bogus fields no longer highlighted by fieldWithErrors. In the railscasts video it works, but not on my app that I am currently upgrading from 2.x to 3.0. In railscasts Ryan doesn't have to test manually if the field has an error. Anyone run into this issue? --

[Rails] Re: Custom form error messages

2011-02-07 Thread Fernando Perez
My bad I just realized that they switched from camelCase css naming to underscores. I think Rails 3 introduced too many insignificant changes that are a pain in the butt to track. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Re: Question on attr_protected and attr_accessible

2011-02-07 Thread Fernando Perez
Do you prefer attr_protected or attr_accessible? I used to only use attr_accessible, but usually my model only has one field to be protected, so it becomes a pain to write: object.attr1 = ... object.attr2 = ... etc I am considering the use of attr_protected with tests to make sure that the

[Rails] [Rails3] How to localize attributes of non AR models

2011-02-07 Thread Fernando Perez
I have a Contact model that is a non activerecord model. I can use the validation thanks to Rails3, but I do not in which section of en.yml/de.yml I should localize the attributes of my Contact model. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Which install method for rvm on production server?

2011-02-06 Thread Fernando Perez
Hi, I read a lot of stuff about rvm so I want to use it on my production server, but which installation method should I use? site-wide? Thanks for your advice -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Which install method for rvm on production server?

2011-02-06 Thread Fernando Perez
I use a system wide deployment ( http://rvm.beginrescueend.com/deployment/best-practices/ ) Fred Thank you Fred, I had missed that page. By the way I read that it is suggested to use a different user per application. Therefore, is there a general rails deployment best practices somewhere?

[Rails] Re: Which install method for rvm on production server?

2011-02-06 Thread Fernando Perez
On my Leopard dev machine I have installed rvm+1.9.2 and everything seems fine, function, rubygems, environment, etc. But when I want to install my first gem (hint: rails 3) I get the following error message: $ gem install rails ERROR: While executing gem ... (Errno::EACCES) Permission

[Rails] Re: Which install method for rvm on production server?

2011-02-06 Thread Fernando Perez
Fernando Perez wrote in post #979907: $ gem install rails ERROR: While executing gem ... (Errno::EACCES) Permission denied - /Users/fernando/.gem/specs From what I have read here and there, it seems that this directory was chowned to root when I used evil sudo gem install I delected

[Rails] Re: Login connection between two websites

2011-01-12 Thread Fernando Perez
You can't do that accessing cookie. You could create a button with an authentification data so that the other website will receive the authentification data and can login a user. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Markdown parser for auto html link

2011-01-08 Thread Fernando Perez
Hi, Does anyone know about a Markdown parser (or why not textile) that can automatically interpret a string that looks like http://...; as a hyperlink? I find it painful to type the square brackets and the parenthesis when I just want to enter a short url that speaks for itself. -- Posted via

[Rails] Re: Markdown parser for auto html link

2011-01-08 Thread Fernando Perez
Thanks! I am currently using rdiscount but had missed that feature when reading the docs. -- 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 group, send email to

[Rails] Re: Re: Markdown parser for auto html link

2011-01-08 Thread Fernando Perez
You can also use the ruby helper autolink() on the return from whatever parser you use. rdiscount will be faster so I'll use it for that purpose, thanks for the tip though; I never knew about that method before. You can't imagine how easier my life has just become! -- Posted via

[Rails] Re: Any easy way to change a Name for a Model?

2010-09-21 Thread Fernando Perez
You also have to search and replace all occurrences of Books. I hope you have some tests to back you up. -- 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 group, send email to

[Rails] Re: Re: Any easy way to change a Name for a Model?

2010-09-21 Thread Fernando Perez
Programming is not generally about feelings. I feel good when I use Ruby, I feel bad when I use PHP. Stop sleeping with your computer! -- 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

[Rails] Re: Rails friendly Forex broker?

2010-09-05 Thread Fernando Perez
The thing is to make your rails app communicate with the broker's api. Like any other webservice. There is nothing specific to trading except the rails app will act as a daemon and will communicate all the time with the web service. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: What does mean in a sql query?

2010-09-04 Thread Fernando Perez
!= -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Decimal numbers pain

2010-09-04 Thread Fernando Perez
Hi, What do you guys use to definitely handle decimal numbers? This is getting me crazy! I use BigDecimal, but it craps out of the input number is something like 14,53, Rails transforms it as 14.0 Any solution? -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: What does mean in a sql query?

2010-09-04 Thread Fernando Perez
Do you understand what it means? It's probably a validates_uniqueness_of that adds that additional query. -- 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 group, send email to

[Rails] Re: Pass a value from controller to model

2010-09-04 Thread Fernando Perez
It should work. What makes you think it doesn't? -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this

[Rails] Re: Cannot seem to display Comments on User Show Page

2010-09-04 Thread Fernando Perez
You almost have it all correct, just in your view: %= form_for([...@article, @comment]) do |f| % -- http://digiprof.tv -- 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 group,

[Rails] Re: Nothing is being inserted into the database...help!

2010-09-04 Thread Fernando Perez
And your controller should be put on a diet... -- http://digiprof.tv -- 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 group, send email to rubyonrails-t...@googlegroups.com. To

[Rails] Re: Decimal numbers pain

2010-09-04 Thread Fernando Perez
It seems Rails does it a bit differently. Anyway I was able to find a solution: http://gem-session.com/2010/03/how-to-use-the-comma-as-decimal-separator-in-rails-activerecord-columns-and-text-fields -- http://digiprof.tv -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Authlogic user login and register new user side-by-side

2010-09-04 Thread Fernando Perez
and then rendering a partial of the login form on the 'new' action of users. Am I in the right direction? Yes, simply render a partial for registration on login page or vice-versa. See this example: http://suivauto.com/login -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Paperclip not saving images

2010-08-24 Thread Fernando Perez
Awesome that solved it! Much appreciated :) I fell into that trap a few times in the past, so now I can quickly notice it ;-) -- http://digiprof.tv -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Paperclip not saving images

2010-08-23 Thread Fernando Perez
Try creating a photo manually, so in script/console type: Photo.create(:data = File.new(/path/to/a/file)) Also check the rails log file for any warning/error message, beware it can be hard to spot in all the lines that get printed. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: Paperclip not saving images

2010-08-23 Thread Fernando Perez
There is a WARNING message in the log. Can't see it? I told you it was hard to spot. So to solve your problem or at least move a step forward, change Album so that it reads: attr_accessible :name, :photos_attributes -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Cleanly handling sub-generatede files with Paperclip

2010-08-21 Thread Fernando Perez
Hi, Let's say I upload a pdf file. Imagemagick extracts all pages out of it and stores the png images on the hard-drive. How to easily handle all these generated files with Paperclip? Has anyone done that before? Thanks for your advice -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: Cleanly handling sub-generatede files with Paperclip

2010-08-21 Thread Fernando Perez
Parker Selbert wrote: Interesting approach. In particular problem you ran into in practice? Too many files for the fs? Database blowing up? Other? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: Re: Postgres, concurrency, and rails

2010-08-20 Thread Fernando Perez
Zach Brod wrote: It must be the ancient version of Rails we are using then. The postgresql_adapter requires a gem (whatever version, postgres-pr, ruby-postgres, etc) that calls itself 'postgres', and I imagine pg only responds to 'pg'. Perhaps Rails 3.0 requires either postgres OR pg. It

[Rails] Re: Getting Started with Rails, Postgres, db:create

2010-08-20 Thread Fernando Perez
So I created the postgres account blog and gave that account the ability to create databases and users. I guess this assumption is wrong. How did you create the blog user in postgresql? You probably forgot an option when creating it. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: postgresql duplicate key violates unique constraint

2010-08-18 Thread Fernando Perez
Robby Russell wrote: On Apr 29, 2006, at 5:56 PM, Guido Sohne wrote: Throws an exception due to the following SQL error: duplicate key violates unique constraint. Your primary key index isn't in sync or something. SELECT MAX(id) FROM entities; SELECT nextval('entities_id_seq');

[Rails] Re: RE: postgresql duplicate key violates unique constraint

2010-08-18 Thread Fernando Perez
I ran into this issue when I backuped a database and restored it back into another system. -- 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 group, send email to

[Rails] Re: Best way to render partial

2010-08-16 Thread Fernando Perez
I prefer [1] as it's less painful to write the views. -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from

[Rails] Re: Form validation and processing w/o model (no Db/ActiveRecord)

2010-08-16 Thread Fernando Perez
Here is what I do: class Tableless ActiveRecord::Base def self.columns @columns ||= []; end def self.column(name, sql_type = nil, default = nil, null = true) columns ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) end end Class Contact

[Rails] Re: paperclip -background process

2010-08-16 Thread Fernando Perez
Is it possible to put the actual file upload itself into a background process? No you can't, your web browser must keep its window active with the upload page, if you redirect or whatever during upload, then uploading breaks. -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] assert_redirected_to partial assertion does not work?

2010-08-16 Thread Fernando Perez
Hi, From the docs I see: http://api.rubyonrails.org/classes/ActionController/Assertions/ResponseAssertions.html This match can be partial, such that assert_redirected_to(:controller = weblog) will also match the redirection of redirect_to(:controller = weblog, :action = show) and so on But it

[Rails] Re: Default rendered error file and hash to nice string how

2010-08-15 Thread Fernando Perez
I think I'm experiencing an issue with Hash#inspect: if one of the values holds a file, it seems Ruby keeps it as a file, so I'll let you guess what may happen if the file is a bit big when I just expect a little string to represent that file... -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-14 Thread Fernando Perez
Ok so there is definitely a bug, thanks for sharing your experience. I hope it gets fixed quickly. -- 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 group, send email to

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-12 Thread Fernando Perez
Parker Selbert wrote: attempted to solve this, but here is the approach I've followed: Hi Parker, thanks for your message, I was considering doing it that way, so I'll go for it. Best regards, -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-12 Thread Fernando Perez
thumbnail etc. In that scenario the format stays the same, so if you use a jpg you'll have a thumbnail jpg as well. Still what's strange is that it should use the :format option I provided, that's what's written in the docs, so if a jpeg is upload, one of its style can be a png. And by

[Rails] Re: User Authentication plugin

2010-08-12 Thread Fernando Perez
Authlogic -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: ActiveRecord errors ... Best way to rescue a live web application?

2010-08-12 Thread Fernando Perez
in your ApplicationController, define: def rescue_action(exception) super # optional # your code end -- 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 group, send email to

[Rails] Re: Background Job

2010-08-12 Thread Fernando Perez
Fernando Perez wrote: Hi, Is the plugin Background Job still a good solution for someone who wants an easy way to manage serial task processing? Up :) What's the current state of background jobs handlers? -- Posted via http://www.ruby-forum.com/. -- You received this message because you

[Rails] Re: Background Job

2010-08-12 Thread Fernando Perez
It's working quite well for us. The persistent queue was the most important aspect for me. Hi Bill, thanks for your feedback. Did you also consider delayed_job? It's a tie between the two of them. I just read that github was using Bj, then moved on to dj and now runs resque? I do understand

[Rails] Re: Problem with changing from mySql to PostrgreSql with rails

2010-08-12 Thread Fernando Perez
by doing some research on Google, I found out that it's a DB Engin problem. MySql allows me to do it but PostgreSql does not. How can I run the same query on PostgreSql. I've run into such problem when I changed from MySQL to PostgreSQL some time ago. basically MySQL is to databases what

[Rails] Paperclip generating crap urls on server, works on dev

2010-08-11 Thread Fernando Perez
Hi, I have the following: has_attached_file :data, :styles = {:theora = {:format = ogv}, :still = {:format = jpg}, :small = {:format = jpg}}, :url= /uploads/products/:basename:suffix.:extension, :path = :rails_root/uploads/products/:basename:suffix.:extension Let's say I upload a

[Rails] Re: Paperclip generating crap urls on server, works on dev

2010-08-11 Thread Fernando Perez
Okay so it has to do with caching. On my dev machine, if I switch to production environment I get the same behavior. I don't know what's the solution. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: uninitialized constant WillPaginate::LinkRenderer

2010-08-08 Thread Fernando Perez
David wrote: This became painful for me too, until I inspected the class hierarchy of the new will paginate. You need to extend WillPaginate::ViewHelpers::LinkRenderer instead. Thanks! It should be better documented when they break things. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Paperclip Trouble - Not Writing to the Database

2010-08-07 Thread Fernando Perez
This is wrong: :url = /public/data/, :path = :rails_root/public/data/ It should look like: :url = /public/data/:style/:basename.:extension, :path = :rails_root/public/data/:style/:basename.:extension -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Paperclip not finding imagemagick on prod, works on dev

2010-08-07 Thread Fernando Perez
Simply adding Paperclip.options[:command_path] fixed the issue, but I swear I tried it yesterday! -- 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 group, send email to

[Rails] Re: Shouldn't XXX.all mean no more queries?

2010-08-07 Thread Fernando Perez
Since, in my view if I later do Pages.find(1) that causes another query ? That's normal behavior. You can't expect Rails to be clever enough to read into your mind that way. You could write your own method to search for a Page with id of 1 inside your array. -- Posted via

[Rails] Re: Paperclip Trouble - Not Writing to the Database

2010-08-07 Thread Fernando Perez
A. Leek wrote: But it's still not fixing the SQL query. Then I'd guess you have attr_accessible? I have fallen into that trap in the past too ;-) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Paperclip not finding imagemagick on prod, works on dev

2010-08-06 Thread Fernando Perez
Hi, I am using paperclip to attach documents to my models. it works perfectly on my dev machine, but on the server I get a CommandNotFoundError. On my server if I ./script/console I can run imagemagick through system(convert) and it works, so why can't paperclip find it? Thanks for your ideas

[Rails] Re: Paperclip not finding imagemagick on prod, works on dev

2010-08-06 Thread Fernando Perez
Hassan Schroeder wrote: Chances are the *web server* is running under a user id other than yours, and so has a different $PATH. Interesting, and I think you are right. However the problem might be similar to these: *

[Rails] Re: Paperclip not finding imagemagick on prod, works on dev

2010-08-06 Thread Fernando Perez
I'll also add this: http://www.ruby-forum.com/topic/214031 I'm running Nginx+Passenger, and it seems there are issues with ImageMagick. -- 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

[Rails] config.gem 'hpricot' still wants require 'hpricot'

2010-08-04 Thread Fernando Perez
Why do I need to add require 'hpricot' if I already have defined config.gem 'hpricot' in environment.rb? The strange thing is that when I use script/console I can use Hpricot directly Oo -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] Re: YAUANA: Yet Anather, Unknown Action - No Action respong to

2010-08-04 Thread Fernando Perez
Why don't you use resourceful routes? -- 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 group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send

[Rails] Re: Rails is slow to load

2010-08-04 Thread Fernando Perez
This doesn't seem normal to me when I watch some screencasts. If this is not normal behaviour, how can I figure out the source of the problem? Maybe they edited their videos to prevent wasting time watching rails load? -- Posted via http://www.ruby-forum.com/. -- You received this message

  1   2   3   4   5   6   >