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
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
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
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
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
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/.
--~--~--
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/.
--~--~-~--~~~-
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
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"
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
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
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/.
--~--~-~--~~~-
> 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
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/.
--~--~-~--~~
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
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
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/.
--~--~-~--~~--
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
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
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
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
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
22 matches
Mail list logo