by http://webgeektutorials.blogspot.com
Showing posts with label tips for ROR. Show all posts
Showing posts with label tips for ROR. Show all posts

Wednesday, May 18, 2011

Active Record - Save without callbacks

p = Post.first

p.title = "test"

p.send(:update_without_callbacks)



for sharing this information..

Wednesday, March 16, 2011

Ruby : Google map, markers and bounds

You can use a function to load Google map with Marker and bounds, function is as below.

function initialize(lat, lon, div_id) {
var myLatlng = new google.maps.LatLng(lat, lon);
var myOptions = {
zoom: 8,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var bounds = new google.maps.LatLngBounds ();
var map = new google.maps.Map(document.getElementById(div_id), myOptions);
var trucklatlng = new google.maps.LatLng(lat,lon);
var marker = new google.maps.Marker({
position: trucklatlng,
map: map,
title:"Assist"
});

Friday, February 11, 2011

How well you know Interactive Ruby Shell?

The Interactive Ruby Shell, more commonly known as IRB, is one of Ruby's most popular features, especially with new developers. You can bash out a one-liner, try a method you've just learned about, or even build a small algorithm or two without going the whole way to writing a complete program.
I've started learning ruby, so while I've been digging through some of the best content I can find on IRB learning all about its internals and ways to get more out of it and big thanks to all of those guys who contributed great knowledge on web, thought I should share some of best contents gathered :

Try out some trick in your IRB console:

irb> Kernel.methods.each do |method| puts method; system "/usr/local/bin/ri --no-pager Kernel##{method}"; ch = STDIN.getc; break if (ch.chr == 'q') end

Once you enter this just keep hit enter until you want to quit, at that point hit ‘q’ and enter.


How to clear IRB console ?

On Mac OS X or Linux you can use Ctrl + L to clear the IRB screen. But in windows i don't know how but yes i know the dos command 'cls' which clears screen. so simply i'm calling this command using system.

Monday, February 7, 2011

Developing iPhone app using Ruby on Rails

This article focused on the structure needed to support separating content for iPhone and iPod touch users, very well written by Noel Rappin. It covered how to manage the viewport to display Mobile Safari content at the right size and scale, and started to discuss what to place in the basic layout of your mobile site.
Part 2 covers how to display your content in a Mobile Safari browser. It also looks at the UI guidelines for managing iPhone content and explores how to make those guidelines come to life in your own Rails application.

Follow these links :
Developing iPhone applications using Ruby on Rails Part 1
Developing iPhone applications using Ruby on Rails Part 2
Developing iPhone applications using Ruby on Rails Part 3

Noel Rappin is the vice president of the Rails practice at Pathfinder Development (http://www.pathf.com), and has a decade of experience with web application development. He has a doctorate from the Georgia Institute of Technology, where he studied how to teach Object-Oriented design concepts. He is the author of Professional Ruby on Rails, and the co-author of wxPython in Action and Jython Essentials. Read more at http://www.pathf.com/blogs and http://10printhello.blogspot.com.

Tuesday, January 11, 2011

Netbeans Tips for ROR


This editor indents, completes, and highlights your Ruby code syntactically as well as semantically. It assists you with rename refactoring, type inference, and navigation. The editor parses your code live as you type, so it can match words and brackets, mark errors and occurrences, and display new quick fixes and RDoc. With a few keystrokes you insert commonly used code snippets from live templates.


Here are some tips and shortcuts for those who are working on Ruby On Rails and using Netbeans, it is designed to be printed on an A4 sheet of paper and live by a developers desk, to make life a bit easier.

Monday, January 10, 2011

Ruby Cheat Sheet

A quick reference guide for Ruby , containing the default directory structure, predefined variables, methods, reserved words and regular expression syntax.
The Ruby cheat sheet is designed to be printed on an A4 sheet of paper and live by a developers desk, to make life a bit easier. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size Ruby cheat sheet.
Ruby on Rails includes tools that make common development tasks easier "out of the box", such as scaffolding that can automatically construct some of the models and views needed for a basic website. Also included are WEBrick, a simple Ruby web server that is distributed with Ruby, and Rake, a build system, distributed as a gem. Together with Ruby on Rails these tools provide a basic development environment.

Ruby on Rails Cheat Sheet

A quick reference guide for Ruby on Rails, containing the default directory structure, predefined variables, methods, reserved words and regular expression syntax.
The Ruby On Rails cheat sheet is designed to be printed on an A4 sheet of paper and live by a developers desk, to make life a bit easier. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size Ruby On Rails cheat sheet.

Tuesday, December 28, 2010

Which Web Language?

When choosing web design languages, make sure you take some time to research your options to ensure you're making the best choice for your project.
When you think about the language you are using to design your website keep in your mind “what is important about web design language, and what part of web design efforts can you take or leave?”.
If you like to create and publish your own web or blog, your first step should be to decide what type of web you would like to create and what web design language you would like to use.

 

Hypertext Markup Language (HTML)

HTML, which stands for HyperText Markup Language, is the predominant markup language for web pages. A markup language is a set of markup tags, and HTML uses markup tags to describe web pages.
This language is so simple you can type the syntax into a text editor, such as Notepad, save it with an .html extension and instantly have a web page. HTML can also be used to include Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both HTML and CSS standards, encourages the use of CSS over explicit presentational markup