flash[:notice] is meant only for redirect action, because the message is only cleared after the redirected view request. So if you don’t redirect the request, and you click on the next request, that message will still be displayed. But sometimes, we just want to display custom error messages only for current request without the redirection [...]
Posts Tagged ‘tips’
Rails flash[:notice] problem
Posted in Ruby on Rails, tagged bug fixes, lessons, Ruby on Rails, tips on November 20, 2008 | Leave a Comment »
Running Rails code through cron job
Posted in Ruby on Rails, tagged lessons, programming, Ruby on Rails, tips on November 20, 2008 | Leave a Comment »
Rails comes with a script/runner script that can be used to run the code in your Rails app. There’re many ways to organize your code to let this runner script execute it, but one obvious way is to write the code as a model’s action. Here are quick steps for doing this: 1. Insert the [...]
Why Rails?
Posted in Ruby on Rails, tagged funs, lessons, programming, Ruby on Rails, tips on October 24, 2008 | Leave a Comment »
Inspect Javascript Object
Posted in Javascript, tagged javascripts, lessons, programming, tips on October 21, 2008 | Leave a Comment »
function inspect_object( obj ) { var str = ”; for( var memb in obj ) str += memb + ‘ = ‘ + obj[memb] + ‘n’; alert(str); return str; }
Debugging Rails View
Posted in Ruby on Rails, tagged lessons, Ruby on Rails, tips on September 23, 2008 | Leave a Comment »
<% if ENV['RAILS_ENV'] == ‘development’ %> <div id=”debug_info”> <%= debug session %> <%= debug params %> </div> <% end %>