Freeze and Unfreeze Rails application
Ruby on Rails allows you to “freeze” the version of Rails used by your application. When you freeze Rails, your … Continue reading Freeze and Unfreeze Rails application
Ruby on Rails allows you to “freeze” the version of Rails used by your application. When you freeze Rails, your … Continue reading Freeze and Unfreeze Rails application
All you need to do is add the following two entries in the location listing in the server conf settings … Continue reading Password protecting folders or resource with Nginx
This URL contains special characters, which Ruby can’t handle: URI.parse ‘http://www.yr.no/sted/Finland/Västra_Finland/Askainen/varsel.xml’ URI::InvalidURIError: bad URI(is not URI?): http://www.yr.no/sted/Finland/Västra_Finland/Askainen/varsel.xml 3 from /usr/local/lib/ruby/1.8/uri/common.rb:436:in … Continue reading How to fix “Bad URI (is not URI?)”
Code in Layout: <head> <title>Merry Christmas!</title> <%= yield(:head) %-> </head> Code in View: <%- content_for(:head) do -%> <%= javascript_include_tag :defaults … Continue reading Javascript Include Tag Best Practice in a Rails Application
Now a days many developers are developing web application using ruby on rails. But a few of them know what … Continue reading Difference Between Gem and Plugin
Procs and Blocs is the part of Ruby which is not clear to many. This post should help you clear … Continue reading Learn Ruby – Procs, Blocks, Lambda
Javascript Code: function previewWindow(id) { var win = window.open(null, “PreviewWindow”, “width=610, scrollbars=1”); var c = document.getByElementID(id).innerHTML; win.document.writeln(“<html><head><link rel=’stylesheet’ type=’text/css’ href=’/stylesheets/global.css’ … Continue reading Content preview using javascript
Tested on – Ubuntu Linux 9.10 and MySQL 5.0 Set / change / reset the MySQL root password on Ubuntu … Continue reading Set / Change / Reset the MySQL root password on Ubuntu Linux
For shortcut key lovers, here is a long list of keyboard shortcuts for Ubuntu Linux. Enjoy the list. General keyboard … Continue reading Keyboard shortcut keys in Ubuntu Linux.
When you create any migration you’ll see something like this: > script/generate migration one create db/migrate/20080402122512_one.rb Rails generate migration number … Continue reading What’s New in Edge Rails: UTC-based Migration Versioning
An extremely productive web-application framework. Written in Ruby by David Heinemeier Hansson. You could develop a web application at least … Continue reading What makes Ruby on Rails on top?
Consider the example, suppose you want to build url such as http://localhost:3000/maps/Europe/Italy/Milan in this case http://localhost:3000/maps/ this path is common … Continue reading Rails: Route Globbing (Building dynamic urls)
1. Recursive Permission for directory and all its sub-directories chmod -R 777 directory_name* Value Permission Directory Listing 0 No read, … Continue reading Some useful linux commands.
A fast new browser: Now available for Linux. Google Chrome runs web pages and applications with lightning speed. Just chick … Continue reading Google Crome for Linux Operating System!
sort_by @posts.sort_by(&:date).each do |post| puts post end group_by @tasks = {} TaskList.find(:all).group_by(&:type) do |type, subtasks| @tasks[type] = subtasks.group_by(&:name) end Continue reading Rails sort_by and group_by
Code in View: function serialize_fields(){ var fields = new Array(); fields.push(Form.Element.serialize(‘content_node_name’)); fields.push(Form.Element.serialize(‘content_node[destination_id]’)); fields.push(Form.Element.serialize(‘content_node[parent_id]’)); fields.push(Form.Element.serialize(‘cont_id’)); return fields.join(‘&’); } <%= observe_field “content_node_name”, … Continue reading observe_field in Ruby on Rails (another way to use ajax)
// order_content_node it is an form name function validateAllTextfields() { for(i=0; i<document.order_content_node.elements.length; i++) { element = document.order_content_node.elements[i]; if (element.type == … Continue reading How to validate all text fields from form using javascript?
In View: This below javascript to get the current values from form such as content node name, destination, and parent … Continue reading Simple example for link_to_remote in Rails (One way to use Ajax in Rails)