[Rails] Re: Pagination: Last Page

2009-06-11 Thread PP Junty
you should use blank? instead of nil? because even the original will_paginate will throw an error if you pass an empty string. and you should not rely on what you receive in the param :page as a user could manually alter the url to some strange value. what i do is to have a parse method that ensur

[Rails] Re: Developer + Web Designer available for remote work

2009-06-09 Thread PP Junty
from the new topic page, just above the submit button: "Attention: posting any kind of advertisement for commercial products or services, unless in reply to a related question, is prohibited." -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You r

[Rails] Re: Pagination: Last Page

2009-06-09 Thread PP Junty
just a correction. by "that happens specially when the last item of a page is deleted." i meant "that happens specially when the last page has only one item and the item is deleted." -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received t

[Rails] Re: Pagination: Last Page

2009-06-09 Thread PP Junty
ok, i made a little plugin with this functionality, it is attached. definitely not a pro solution but may be useful. could you test it and see if it is working? if it is i could publish it on github. this plugin also alter another behavior that i find annoying, which is: when you request a page gr

[Rails] Re: Pagination: Last Page

2009-06-08 Thread PP Junty
i had the same problem. some people already asked this feature to be added to will_paginate, apparently the developer doesn't think it is a good idea. check this: http://groups.google.com/group/will_paginate/browse_thread/thread/9c4ff183a4271bde/3f71f7dc31a54767 for my projects i made an extensi

[Rails] Re: Java kicks Rails's butt - it says right here!

2009-05-26 Thread PP Junty
Steve, you don't need to go too far, just take the subtitle and the very first sentence: "This article demonstrates that Java is more productive than Ruby" "This article tries to demonstrate that Java can be more productive than Ruby." -- Posted via http://www.ruby-forum.com/. --~--~--

[Rails] Re: modern day auth

2009-05-22 Thread PP Junty
Check Authlogic (http://www.binarylogic.com). But I advise you to take a very good look at the code and docs because it makes a lot of trade-offs in order to make it a "plug-and-play" gem instead of a generator. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~-

[Rails] Re: Github and Plugins

2009-05-17 Thread PP Junty
it should commit. does your .gitignore file have a rule preventing 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, se

[Rails] Re: First RoR Aplication - images/css paths

2009-05-11 Thread PP Junty
a good way to avoid such path issues is to use the image_tag helper method: image_tag("icon") # => -- 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: Is Rails in decline?

2009-05-11 Thread PP Junty
Rob Biedenharn wrote: > There are plenty of people/companies working with Rails. The fact that > it is in decline *for you* (you let yourself be hired away after all) > doesn't mean that the industry is being lured away from the power and > expressiveness of Ruby (and Rails) so easily. I don't ag

[Rails] Re: no sql in the controller guideline

2009-05-06 Thread PP Junty
thanks for the tips Phlip, specially the "How easily can you test your SQL-like statement?" metric. Phlip wrote: >>> "Nothing that looks at all like SQL should go into a controller, view, >>> or helper." > Helpers are a gray area. In software design, there is the concept of > breaking up low-lev

[Rails] Re: Problem caching Model instances on a constant in Rails

2009-05-06 Thread PP Junty
at first looks like the old problem of rails reloading the classes and not recognizing the objects in memory anymore. try set "config.cache_classes" to true in your development.rb file or run in production mode. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~-

[Rails] Re: no sql in the controller guideline

2009-05-05 Thread PP Junty
> The code you posted is fine, it just depends where you put it: that is why i named the thread "no sql in the controller". :) > - in a view: super bad > - in the controller: not so good i agree, i just didn't see any mention to this guideline in the books i consulted or in the AR source code c

[Rails] Re: no sql in the controller guideline

2009-05-05 Thread PP Junty
Charles Johnson wrote: > Like all good programming rules of thumb there are interesting > exceptions. this is exactly where things get confused, because code like the example i provided seems to be the norm, not the exception. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~

[Rails] no sql in the controller guideline

2009-05-05 Thread PP Junty
hello. i just checked Chad Fowler's post "20 Rails Development No-No's" and one guideline caught my attention. it says: "Nothing that looks at all like SQL should go into a controller, view, or helper." it really came as a surprise to me as Rails itself seems to go against such practice by its A

[Rails] Re: where do helper for a controller go?

2009-04-23 Thread PP Junty
in fact, if you are beginning, Altered Beast is better (just got a nice tip there :). -- 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 t

[Rails] Re: where do helper for a controller go?

2009-04-23 Thread PP Junty
Heinz, methods in the helpers will be available (included) in the views, not in the controllers. Check a nice open source project, like the Mephisto, so you can see how more experienced railers solve such design problems. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~--

[Rails] Re: what escape or sanitize functions are out there?

2009-04-22 Thread PP Junty
i have been using the xss_terminate plugin: http://github.com/look/xss_terminate/tree/master basically it sanitizes values before they are stored in the database: "Installing the plugin creates a +before_save+ hook that will strip HTML tags from all string and text fields. No further configura

[Rails] Re: Passenger caching in development mode, wtf?

2009-04-14 Thread PP Junty
perhaps here: http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMethod but can't you use mongrel for development and passenger for production? Petr Janda wrote: > I just tested with Ruby 1.8 and its the same behaviour. > > An clues people? -- Posted via http://www.ruby-forum

[Rails] Re: will_paginate

2009-03-16 Thread PP Junty
check what parameters are being sent in the first request and compare with the links that will_paginate is generating. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: Adding a Form Cancel Button

2009-03-16 Thread PP Junty
andrew, the problem i see is that you depend on the label of the button. if a user wants to change the label of one button, let's say to "Abort", then it requires another method for this particular button. using <%= submit_tag 'Any Label', :name => 'cancel' %> and def check_for_cancel unles

[Rails] Re: Adding a Form Cancel Button

2009-03-16 Thread PP Junty
eric, i didn't find a better solution either. i'd not choose the javascript solution for two reasons. because it depends on the client's configuration/behavior and, most importantly, because sometimes the user wants to see an explicit message from the server that the action was indeed canceled