Thursday, October 15, 2009

Ruby on Rails : Comment Single line / Multiple lines

Comment single line of code is using "#", however, for multiple line is using "=begin" and "=end" in .rb, and "<!-- -->" in .rhtml.

In Controller.rb

    # Single line
    # PUT /people/1
    # PUT /people/1.xml

    def update
      @person = Person.find(params[:id])
=begin (Multiple lines)
      respond_to do |format|
       if @person.update_attributes(params[:person])
        flash[:notice] = 'Person was successfully updated.'
        format.html { redirect_to(@person) }
        format.xml { head :ok }
        format.html { render :action => "edit" }
        format.xml { render :xml => @person.errors, :status => :unprocessable_entity }


In View.rhtml
<!-- Single Line -->
<% # @people = Person.find(:all) %>

<!-- Multiple Lines -->
<% for person in @people %>
<%= %>
<% end %>


  1. Thanks for sharing such a nice tip. Whenever some one is new to web development it is very important to first learn programming language as per my knowledge. Well ruby is one of the best programming language for Rails development. If you are looking for ROR developers in India email us at:

    1. When you are searching to hire a website design company then you should always choose reliable and professional, Revise is the best government website design company which contains good record and be ready to give you site according to your needs.

  2. Thanks for the tips on the comment single line in ROR. You can find related web development tools and resources here.

  3. Great article Lot's of information to Read... Great Man Keep Posting and update to People..Thanks

    java forums

  4. perfect explanation about java programming .its very useful.thanks for your valuable training in chennai | java training in chennai chennai, tamil nadu

  5. Great, what a collaboration. I love your blog post. keep sharing. Thanks
    Hire RoR Developer

  6. Great sharing. Cryptex Technologies Pvt. Ltd. is an IT company which focuses on providing services to client. The company works on Ruby on Rails Platform since it was started in October 2007. If you are looking for ruby on rails developers in india, then contact us at:

  7. After reading this blog i very strong in this topics and this blog really helpful to all... explanation are very clear so very easy to understand... thanks a lot for sharing this blog more info on Ruby on Rails Online Training

  8. Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. ROR Development Company India,

  9. I’m trampled by your contents carry on the wonderful work. array

  10. Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
    Click here:
    angularjs6 Training in Chennai
    Click here:
    Microsoft azure training in chennai
    Click here:
    angularjs6 Training in Chennai
    Click here:
    angularjs Training in online

  11. Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
    Click here:
    Microsoft azure training in chennai
    Click here:
    Microsoft azure training in annanagar
    Click here:
    Microsoft azure training in velarchery
    Click here:
    Microsoft azure training in sollinganallur

  12. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    DevOps online Training|DevOps Training in USA
    Devops Training in Chennai

    Devops Training in Bangalore

  13. Pleasant Tips..Thanks for Sharing….We keep up hands on approach at work and in the workplace, keeping our business pragmatic, which recommends we can help you with your tree clearing and pruning in an invaluable and fit way.

    Data Science Training in Chennai | Data Science course in anna nagar
    Data Science course in chennai | Data science course in Bangalore
    Data Science course in marathahalli | Data Science course in btm

  14. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    java training in chennai | java training in USA

  15. Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.
    AWS Training in Chennai |Best Amazon Web Services Training in Chennai
    AWS Training in Rajaji Nagar | Amazon Web Services Training in Rajaji Nagar

    Best AWS Training Institute in BTM Layout Bangalore ,AWS Coursesin BTM

  16. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

  17. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    Microsoft Azure Training in Chennai | Azure Training in Chennai