Feeds:
Posts
Comments

Posts Tagged ‘tips’

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

Read Full Post »

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

Read Full Post »

Read Full Post »

function inspect_object( obj ) { var str = ”; for( var memb in obj ) str += memb + ‘ = ‘ + obj[memb] + ‘n’; alert(str); return str; }

Read Full Post »

Debugging Rails View

<% if ENV['RAILS_ENV'] == ‘development’ %> <div id=”debug_info”> <%= debug session %> <%= debug params %> </div> <% end %>

Read Full Post »

« Newer Posts