Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 6th, 2009, 02:19 AM
Z.K. Z.K. is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2009
Posts: 184 Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level)Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level)Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level)Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level)Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level)Z.K. User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 1 h 40 m 47 sec
Reputation Power: 28
Question ROR confusion using methods

Okay, I am very new to ruby. I have written several standard ruby programs and now I am starting to learn ROR. I am a bit confused though. In a standard ruby program I create a method and then in the main program I pass a variable to the method and have the method print out a value. Now, I know I use the controller file and the index file to do this, but I am unsure exactly how to include the method and to call it.


def print(value)
puts(value)
end

print(10)

I need to do something like this in ROR, but I am not sure just how. It is simple in just a standard ruby program. Any help would be appreciated.


Reply With Quote
  #2  
Old November 25th, 2009, 03:33 PM
jaql jaql is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 4 jaql User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 2 sec
Reputation Power: 0
If it's just a "standard ruby program," why are you using Rails?

Also, google "MVC" and click the first link.

Reply With Quote
  #3  
Old August 22nd, 2010, 11:18 PM
mark@mivvia.com mark@mivvia.com is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 5 mark@mivvia.com User rank is Lance Corporal (50 - 100 Reputation Level)mark@mivvia.com User rank is Lance Corporal (50 - 100 Reputation Level)mark@mivvia.com User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 h 56 m 57 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Suggest you visit rubyonrails DOT org and try the tutorial to see how to build a rails app from scratch. That will show you the basic conventions. From there you should be able to map your application to the rails framework.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > ROR confusion using methods

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap