Saturday, 14 July 2012

How to run all migration once again

I am in middle of some migration version and I want to revert all and run from starting. I have done this by below commands

=> rake db:migrate version=0
=> rake db:migrate

Rails: How to revert created scaffold files

I have created user scaffold and due to some reason i want to delete all files which are created by scaffold.

to generate scaffold i Used this command

=> rails generate scaffold User name:string password:string

Two revert that files created by above command i run this command.

=> rails destroy scaffold User name:string password:string

Wednesday, 4 April 2012

Rails Error: Missing template in view path app/views


My requirement is to render, according to response type
     format.attachment { render :template => ‘errors/permission_denied’, :status => 403 }
     format.html { render :template => ‘errors/permission_denied’, :status => 403 }
but I am getting error like
     “Missing template /errors/permission_denied.erb in view path app/views”
My response type for my request was "attachment"
then I have changed render code with full file name and it works
     format.attachment { render :template => ‘errors/permission_denied.html.erb’, :status => 403 }

Friday, 13 January 2012

Include Html file inside another Html file


To include the html content into another html file I have used java script.
Below is the example where I have used header content and footer content into different file
and called these two files into all files wherever header and footer requires.
Main page content
Content.html
<html>
<body>
<script type=”text/javascript” src=”header.js”> </script>
<p>
Content of the page
</p>
<script type=”text/javascript” src=”footer.js”> </script>
</body>
</html>
header.js file content
document.write(“<h1>Header</h1>”);
document.write(“<h2>Tag Line</h2>”);
footer.js file content
document.write(“<h2>Contact us</h2>”);
document.write(“<h3>9876543210</h3>”);
Out put of content.html file in Browser
Header
Tag Line
Content of the page in details
Contact us
9876543210

Saturday, 26 November 2011

Ooty


Ooty: A Scenic Getaway in the Nilgiris

Ooty, also known as Udhagamandalam, is a charming hill station in Tamil Nadu, known for its pleasant weather, breathtaking landscapes, and rich heritage. With temperatures ranging from 15°C to 20°C year-round and sometimes dipping to 0°C, it's a perfect retreat for nature lovers and adventure seekers.

 

 

Key Highlights

  1. Weather and Location

    • Ooty is home to the highest point in Southern India, the Doddabetta Peak, offering panoramic views.
    • The journey itself is a major attraction, especially the scenic train ride and the thrilling 36 hairpin bends route.
  2. Shopping in Ooty

    • Indulge in local specialties like aromatic tea and handmade chocolates.
    • Don’t miss tasting the variety of chocolates available in local shops.
  3. Distance and Routes

    • From Mysore: Around 130–140 km.
    • Routes:
      • 36 Hairpin Bends Route: Thrilling drive with spectacular views, 35 km from the Bandipur diversion.
      • Normal Route: Longer but smoother, around 50–60 km from the same point, passing through attractions like Pykara Falls and a Shooting Spot 25 km before Ooty.

Places to Visit

  1. Botanical Gardens : A Government-run garden showcasing around 650 species of trees and plants. A peaceful oasis located in the heart of Ooty.

  2. Doddabetta Peak: The highest point in South India, offering mesmerizing views of Ooty, Coonoor, and nearby valleys. Features a telescope house for closer views of the surrounding landscape.

  3. Ooty Lake: A popular spot with options like mini train rides and boating. While it can get crowded and the water isn’t pristine, it’s still a great spot for family outings.

  4. Boating at Pykara: Located on the route to Ooty, Pykara offers cleaner and less crowded boating experiences compared to Ooty Lake.

  5. Shooting Point: A picturesque spot offering stunning views, located on the Mysore-Ooty route. A favorite among photographers and nature enthusiasts.

  6. Train Journey from Ooty to Coonoor: A must-experience heritage train ride, starting at 9:15 AM. Tickets cost approximately ₹3, offering breathtaking views of the Nilgiri hills. Tip: Sit on the right side (opposite the platform) for the best views during the journey.

 


Why Visit Ooty?

  • Adventure and Serenity: From thrilling drives to peaceful gardens, it has something for everyone.
  • Rich Heritage: Explore colonial-era landmarks, including the famous toy train.
  • Natural Beauty: A paradise for photographers and nature lovers.

Ooty promises an unforgettable experience with its serene beauty, cool climate, and rich traditions. Whether you’re seeking adventure, relaxation, or a slice of history, Ooty has it all!