[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 comma ;)

I had to go through this pain for my http://suivauto.com website that 
uses the French "," instead of the "." for decimal points.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 in a breeze.

I'll have to retract that statement. I updated my gems recently and 
passenger got updated as well, for some reason my Nginx+passenger setup 
is now broken. I tried reinstalling Nginx+passenger with rvmsudo but now 
it has permission problems. Why kind of joke is that?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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
>   Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/
> lib/mysql2/mysql2.bundle

Have you installed the mysql server and mysql rubygem?


--
http://digiprof.tv
http://suivauto.com

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 
> 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 'test_helper' line and another time 
when it starts loading the class of the test file.

Can't I just use ruby like before?

$ ruby -I test test/functional/pages_controller_test.rb -n some_test ?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 list all
columns in the table!

What's going wrong? From the Rails guide it seemed straightforward.


Thanks for your help

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 have doubts, since
Travel.create is a class method.

2) how to write my register method() so that it behaves like create()?


Thanks for your help.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 as a reserved word.
What am I doing wrong?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2011-02-14 Thread Fernando Perez
> You would probably be better off skipping RJS and just putting straight
> jQuery into your template, and just name the template edit.js.erb

Ok, so I had figured out that right.

But I don't understand why the update of a div works with a dummy string 
"foo" and does not happen with more stuff such as a form!?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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}",
render('admin/articles/form'))

Obviously when I clicked my edit button that triggers the ajax
replacement of the article by an editable form it failed.

My first surprise was to be greeted by an "Element.update is not a
function" error. I then realized that I cannot use page.replace_html
which is reserved to Prototype.

No big deal I'll create an edit.js.erb file with:

$("#article_<%= @article.id %>").update("<%=
render('admin/articles/form') %>");

The application gets hit, but nothing else happens on the client side.


Anyway, I'm not sure I understand correctly all this ajax stuff in
Rails.

Isn't it an issue to write js code in edit.js.rjs? Since it is dynamic
javascript code, the web browser won't be able to cache it. Am I right?

What's the authoritative way of doing jQuery + Rails3 + Unobstrusive +
Clean + etc?

AWDWR doesn't teach good practices in this point of view.


Thanks

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 module that
> requires some other files. Thus I18n.default_locale is no longer
> relevant.
>
> Rainer

Thanks for pointing out the problem. I just ran into it. Indeed setting 
config.i18n.locale fixed the problem.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2011-02-13 Thread Fernando Perez
Oh ok! I did not understand that now I had to use sanitize to kick the 
whitelist in.

Thanks.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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:



I could use html_safe, but that's painful and makes my code less
readable.

In Rails2 I could declare a whitelist such as:

config.action_view.sanitized_allowed_tags = 'a', 'blockquote', 'img',
...

But it doesn't seem to work anymore. Did I miss anything in the
transition from Rails 2 to 3?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2011-02-13 Thread Fernando Perez
I enabled PermitUserEnvironment for ssh and added GEM_PATH as well as 
PATH to ~/.ssh/environment, and still it had no effect at all. 
Frustrating.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 environment as when I manually connect through ssh?

This separation interactive/non-interactive is stupid to me, and 
unnecessarily complicates things.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



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

2011-02-13 Thread Fernando Perez
Hmmm, strange.

If I run rake remotely, the rake seems to be found but an error is 
raised:

uninitialized constant Bundler

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 a PATH, profile, 
bashrc, etc problem.

So can someone show me a good resource that will clear that for me once 
and for all. I never know the difference between rc/profile, interactive 
login and what have you.

I'd like to get that out of the way because every so often I run into 
this problem and have to struggle to get things sorted out.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 script crapped 
out. No big deal I only need Ruby for my user that runs the application.

So I will use the "normal installation".

I will use Nginx+Passenger. So I install passenger as non root.

Then when I want to install nginx, I should do:

$ sudo passenger-install-nginx-module

which will install in /opt/nginx.

Should I use a non sudo location or stick with sudo for nginx?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 protected attributes are indeed protected.

Did anyone do the jump? Will it fire back at me?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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?

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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
>> (/app/controllers/admin_controller.rb:6: invalid multibyte
>> char (US-ASCII)).
>>
>>
>> After I start the WEBrick server and go to
>> http://localhost:3000/admin/read I get the error. However, if I set #
>> encoding: utf-8 on top of the controller file the error disappear.
>>
>> The question is how can I "officially" correct this error? How can I
>> maintain Rails to proper multibyte characters handling?
>
> Is there a solution to this in 2010?

Self-reply: is there a solution to this in 2011?

I am running Rails 3.0.3 with Ruby 1.9.2 and it still fucks 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 the directory, and as expected rvm/rubygems recreated a new 
one with proper permission.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 denied - /Users/fernando/.gem/specs

The ~/.gem directory belongs to root and seems to have been created on 
the day I reinstalled my system, so it probably belongs to the system's 
ruby. I see a similar directory ~/.subversion, with same ownership and 
date of creation, so I assume it was created by Leopard, or was it 
Macports?

Therefore can I safely chown ~/.gem, or should I destroy this directory 
and let rvm recreate a new one if needed?

Thanks

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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? I might be missing other useful tips.

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 
> might be possible I could modify the adapter but that is probably asking 
> for trouble.

I remember the pain in finding the correct postgresql ruby gem. Indeed 
the latest gem is called "pg", however I can't remember it was 
compatible at the time of Rails 1.2 but I guess so. Maybe use an older 
"pg" gem as Rails has been modified a lot since and so was pg.
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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');
> 
> This should be higher than the last result.
>
> If it's not higher... run this to try and fix it. (run a quick
> pg_dump first...)
> 
> SELECT setval('entities_id_seq', (SELECT MAX(id) FROM entities)+1);


Let me up this thread as it just saved my a$$!

Is this considered a bug or a feature? Because people easily get trapped
into 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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 my case it does not work. As assert_redirected_to(:controller =>
'articles') expects the index action of ArticlesController to be
triggered.


Any idea why I'm getting this behavior?
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 < Tableless
  column :address, :string
  column :message, :text

  validates_presence_of :message, :address
end


It works perfectly in Rails 2.3.8, it might break in Rails 3 I haven't 
tested yet.
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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/.

-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 php is to programming 
languages, i.e: it's permissive.

I guess your query is not fully SQL compliant, but MySQL let's you get 
away with it whereas PostgreSQL complains and wants a legit 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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 that github size is different than mine so what 
works for them might totally fail for me.
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 looking at its source code that's what 
expected to occur.

In dev env it works, but once class caching is turned on, it works once, 
then craps out. I'll see what the devs think about 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 post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: my final year project.

2010-08-11 Thread Fernando Perez
> Remember that RoR is a framework and not a language. Compare it to
> CodeIgniter, CakePHP, Symphony in the PHP space.

No RoR is a thing to build websites, as pure php, symphony, and pure 
ruby do, so it is fair to compare them.

RoR is stuff written in Ruby that avoids writing boiler plate.

Beware 2 months is certainly no enough to get your app going. In real 
life, a usable blog takes more than 15 minutes to get built.

Have fun learning and working with Rails.
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 video called video.mp4, now I want paperclip to
generate the url:

object.data.url(:still) => /some/url/video.jpg


But for some reason on my server, paperclip generates:
/some/url/video.mp4

Moreover, if I update code and restart the server, paperclip will
correctly generate the .jpg extension the first time, but if I reload
the page, it messes up and goes back to .mp4.


Everything works fine on my dev machine (mac mongrel+nginx), and this
strange behavior only happens on the server (freebsd passenger+nginx).


Did anyone experience such weird thing? It's driving me crazy!.
-- 
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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 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 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[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 this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



  1   2   3   4   5   6   >