Posts filed under 'RoR'

Ruby Hero Awards

Reasons to nominate someone

  • They write educational blog posts / tutorials
  • They contribute to a useful open source project
  • They help organize educational events
  • They give free support on the mailing list / IRC

Ruby Heroes was created to show some gratitude and give these people the recognition they deserve. Hopefully the type of recognition that keeps them doing what they’re doing, and continuing to make our community stronger.

Time has come to nominate such person for an honorary award.

Ruby Heroes is produced by the guys over at Rails Envy, and coded up by Brandon Beacher.

To nominate someone, click here.
Ruby Heroes

Add comment April 17, 2008

Heroku & Morph AppSpaces : Rails Hosting

Heroku and Morph Labs are Ruby on Rails hosting providers, offering a complete environment for running Ruby on Rails applications. Compared to traditional hosters, they don’t just give you a server but offer some interesting tools and interfaces to make your live easier and relieve you from all the hassle of installing, configuring, managing and securing a server. Both are using the Amazon EC2 grid computing technology to run the
applications, so you don’t have to worry about scaling and performance issues either.

James Lindenbaum explains the unique features of Heroku:
Heroku is hands down the easiest deployment platform for Rails apps. No humans in the loop, just drop in your code and you’re up and running. Heroku handles everything, from version control and collaboration to auto-scaling (built on top of Amazon’s EC2). We offer a full suite of tools for developing and managing your app, through either the web
interface or our new external API.

Asked about their target audience, James replied:
Honestly, almost everyone who wants to develop or deploy Rails apps should use Heroku. About a third of our users are beginners (many of whom haven’t written a web app before at all), and they love it because they can get up and running instantly. Another third of our users are more serious Rails developers, who just don’t want to deal with the hassles of setup, configuration, and deployment. We have started to offer features for this group over the last couple of months, and thousands of these users have been happily banging away on our private beta. The last third of our users are really hardcore Rails developers.
We’ve just begun to offer features for this group (the API, external access to Git code repositories), and have many more to be released in the coming months. It’s this hardcore group that has accounted for the largest part of the load on our platform over the last 6 weeks.

Morph eXchange is a portal into Morph Labs’ Software as a Service offerings. The Morph AppSpaces can be found in their DevCenter. We asked Macel Legaspi from Morph Labs about the characteristics of their offering:
Morph AppSpaces are a Platform as a Service for Ruby on Rails applications. The Morph AppSpace provides all of the technology and infrastructure needed to deploy, deliver and manage a web application written in Ruby on Rails. Each Morph AppSpace provides a highly available, fault tolerant environment for a web application. Load balancers, distributed application servers, integrated web delivery stacks, security and managed backups are all part of every Morph AppSpace. A Morph AppSpace subscription is near nirvana for a Ruby on Rails web application developer. The Morph AppSpaces run on top of the Morph Application Platform. The Morph Application Platform brings together a collection of open source technologies and Morph intellectual property to provide the Morph AppSpace environment. The Morph Application Platform uses cloud computing including Amazon EC2 and Amazon S3 to provide computer power and online storage as needed by the Morph AppSpaces.

Add comment April 16, 2008

@content_for_layout

If you create a template file in the app/views/layouts with the same name as a controller, all views used by that controller will use that layout by default.controller/store_controller.rb ::::: consists of method1 & method2

def method1
@first_name = “Rajesh”
end

def method2
@last_name = “Kumar”
end

views/store :::::: consists two html method1.rhtml & method2.rhtml

method1.rhtml
<h2>My first name is :: <%= @first_name %> </h2>

method2.rhtml
<h2>My last name is :: <%= @last_name %> </h2>

views/layouts/store.rhtml ::::: same as controller’s name
<html>
<body>
<h4>This is the main template </h4>
<i> Rails automatically sets the variable @content_for_layout to the page specific content- the stuff generated by the view invoked.</i>
<div>
<%= @content_for_layout %>
</div>
</body>
</html>

http:// ………/store/method1
This is the main template
Rails automatically sets the variable @content_for_layout to the page specific content- the stuff generated by the view invoked.
My first name is :: Rajesh

http:// ………/store/method2
This is the main template
Rails automatically sets the variable @content_for_layout to the page specific content- the stuff generated by the view invoked.
My last name is :: Kumar

Add comment February 21, 2008

find(ActiveRecord::Base)

# returns the object for very first row or dierctly put the first row ID like 156789
find_first_as_object = Rating.find(:first)
#p find_first_as_object.ratee_identity_id #1287065605

find_first_as_object_using_idnum = Rating.find(1)  # search for id =1

# returns as an array of object(one element array)
find_first_as_array = Rating.find([569384240])
# p find_first_as_array[0].ratee_identity_id #1287065605

find_first_with_condition = Rating.find(:first, :conditions => [”rating = 4″])

==================================

find_objects_with_selected_attributes = Rating.find(:all,:select => ‘rating as RR’)

my_distinct = Rating.find(:all, :select =>”distinct rating” )

find_first_with_condition_plus_order = Rating.find(:first,
:conditions => [”rating = 4″],
:o rder => “ratingdate DESC”)

===================================

find_all = Rating.find(:all) # returns an array of objects

find_all_by_limit = Rating.find(:all, :conditions => [”rating >= 3 “],:limit => 10)

find_all_by_group = Rating.find(:all,
:conditions => [”rating >= 3 “],
:group => “rating”)

===================================

# find_by_sql returns an ARRAY of objects
find_sql = Rating.find_by_sql(”select rating as goodRating from ratings where rating >=3″)

find_sql_using_var = Rating.find_by_sql(”select * from ratings where id = ?”, ratee_identity_id)

===================================

find_first_by_rating = Rating.find_by_rating(”3″)
# Rating.find(:first, conditions => “rating = 3”)

find_all_by_rating = Rating.find_all_by_rating(”3″)
#  Rating.find(:all, conditions => “rating = 3”)

Add comment February 21, 2008


@@name=PRAYAS

gap_resize.jpg

Time.now()

December 2009
M T W T F S S
« May    
 123456
78910111213
14151617181920
21222324252627
28293031  

order[:category]

posts[:recent]

episodes[:recycled]

links[:favourite]

vote_for_web2.0

Step down at my blog with your ideas,comments,suggestions on Ruby,RoR,Ajax or Web2.0 Technology. You may reach me at rajesh4it@gmail.com.

@visitors.count(Feb’08)

find_all(:categories)

Around me bollywood coding news@RoR Rails RoR Ruby Tools&Tips Web2.0 talks

Vote for RoR

Blog Stats