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 20th, 2007, 02:04 PM
Rayman1986 Rayman1986 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 70 Rayman1986 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 54 m 11 sec
Reputation Power: 9
Embed Ruby On Rails

Okay, so I first consulted google and did not really find my answer.

In php, to call my code I imbed it in <?php ?> tags. How do you do this for Ruby? I tried looking up examples, but all I found was raw code.

Reply With Quote
  #2  
Old November 20th, 2007, 02:15 PM
jzd's Avatar
jzd jzd is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2007
Posts: 1,940 jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level)jzd User rank is General 32nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 4 h 7 m 2 sec
Reputation Power: 3116
Here is a quick example:

<% for column in Contact.content_columns %>
<td><%=h contact.send(column.name) %></td>
<% end %>


Source of example:
http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/

Reply With Quote
  #3  
Old November 20th, 2007, 03:03 PM
Rayman1986 Rayman1986 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 70 Rayman1986 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 54 m 11 sec
Reputation Power: 9
Oooh, okay, I get it, thanx a lot

Reply With Quote
  #4  
Old November 21st, 2007, 09:26 PM
Rayman1986 Rayman1986 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 70 Rayman1986 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 54 m 11 sec
Reputation Power: 9
Sorry to double post..

When I have my html document, and I am uploading to hosting that offers ruby on rails.
Code:
<html>
<body>
<% print "text" %>
</body>
</html>


outputs a very raw text string that literally says <% print "text" %>

I am trying to find guides, but they all seem to walk through what looks like installation of RoR or something. All I know is I want to simply use the code in the website for simple tasks, not create and interface with databases, which all the guides I find seem to want to show me. The guides I find also look like the code is being preformed from a console, which I am not interested in.

Reply With Quote
  #5  
Old December 5th, 2007, 11:41 PM
bloopletech bloopletech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 1 bloopletech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 47 sec
Reputation Power: 0
Hi, the majority of web based Ruby development is done using a framework called Ruby on Rails - or RoR. Rails is a plugin for Ruby. While Ruby has basic CGI stuff, RoR gives you a much better interface for building dynamic websites. Your host will have support for RoR built in, probably. It is RoR that alows you to do <%="hello"%> in your HTML. With RoR, you usually create your project offline (it includes a no-install-required web server), so you can build and test offline, then upload your project to the server to go live. In the long run, RoR will offer you *immense benifits* over trying to do HTML with Ruby. I suggest you look at a couple of RoR tutorials. RoR essentially gives you what PHP gives you, but SO much more.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Embed Ruby On Rails

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