Thursday, 25 October 2012

JP Park Bangalore


Jayaprakash Narayan Park: A Green Haven in Bangalore

In the Garden City of Bangalore, alongside renowned parks like Cubbon Park and Lalbagh, the sprawling Jayaprakash Narayan Park (JP Park) near Mathikere offers another serene escape into nature. This beautifully landscaped park combines greenery, unique attractions, and recreational facilities, making it a favorite spot for visitors of all ages.

Key Attractions

  1. Rock Garden

    • Inspired by the famous Rock Garden in Almatti, this artistic corner of the park features creatively arranged stones and sculptures, adding a touch of charm and innovation.
  2. Nakshatra Vana, Rashi Vana, and Navagraha Vana

    • These themed gardens are dedicated to zodiac constellations and celestial elements.
    • Each zodiac sign (Rashi) and planet (Navagraha) is represented by specific plants, adding a unique spiritual and educational dimension to the park.
  3. 4.5-km Jogging Track

    • A well-maintained jogging and walking track, perfect for fitness enthusiasts and those seeking a peaceful stroll amidst nature.
  4. Ample Parking Space

    • Visitors can enjoy their time in the park without worrying about parking, thanks to its spacious parking area.

Why Visit Jayaprakash Narayan Park?

  • For Nature Lovers: The lush greenery and tranquil ambiance make it a perfect retreat.
  • Fitness and Recreation: Ideal for jogging, walking, and relaxation.
  • Unique Features: Thematic gardens like Nakshatra Vana offer a rare blend of nature and astrology.
  • Family-Friendly: A great spot for picnics and spending quality time with loved ones.

Location

  • Near Mathikere, conveniently accessible from various parts of Bangalore.

Jayaprakash Narayan Park is a must-visit for anyone looking to unwind in the lap of nature while exploring unique attractions rooted in culture and science.









Wednesday, 12 September 2012

Create Model for all Table

Below code will fetch all table names and create model
 ActiveRecord::Base.connection.tables.each do |table|
     model_file = File.join("app", "models", table.singularize+".rb")     
     model_name = table.classify
     File.open(model_file, "w+") do |file|
      file << "class #{model_name} < ActiveRecord::Base\nend" 
     end
 end

Saturday, 18 August 2012

How to activate DBMS_output in Rails

I have added some debug statements in my sql Procedure and I want to see the dbms output content in my test log file
DBMS_OUTPUT.PUT_LINE ('Hello!!!');
I open the console
ruby script/console test
check the enable_dbms_output field is true or not By running the command
ActiveRecord::Base.connection
If it is not true then reset to true by running below command before your testcase.
ActiveRecord::Base.connection.enable_dbms_output
then you can see the dbms_output statements in test.log file.

Rails : Alert message with new line

I was passing the error message by joining each error message with \n and in alert I am getting all error message with \n text instead of new line, below is the code which am passing the message
@product.errors.full_messages.join('\n')
and I am getting something like below Name can't be blank \n Address can't be blank After doing search in google some how I got that I have to give \n in double quote like below
@product.errors.full_messages.join("\n")
and it works..

Rails: Invalid character \240 (syntax error)

I got this error when I copied text from notepad(clipboard) and paste it in Linux server. Some times If you copy some text from notepad and paste it in server you will not notice some Ascii character will be pasted which is not seen better you have to type content instead of copy it from notepad.

Monday, 13 August 2012

Devise Couldn't find User with id=sign_in

I have added routes for devise and users in this manner
AppName::Application.routes.draw do resources :users devise_for :users
and i am getting error like"Couldn't find User with id=sign_in" while trying to login application. I changed the order in routes.rb file then it works
AppName::Application.routes.draw do devise_for :users resources :users

Saturday, 11 August 2012

Rails Migration Datatypes and DDL Methods

Rails DDL Methods
  • add_column
  • remove_column
  • change_column
  • rename_column
  • create_table
  • drop_table
  • change_table
  • add_index
  • remove_index
Data Types for migration
  • binary
  • boolean
  • primary_key
  • date
  • datetime
  • time
  • timestamp
  • integer
  • decimal
  • float
  • string
  • text
for more information click


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