Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

How to link a ruby code with an html code

I just discovered that ruby is a back end language, so i need to embed it into an html language which is a front end language. Can someone please enlighten me on how to do that?

1 Answer

Tim Knight
Tim Knight
28,888 Points

Hi Victor,

As a back-end language there isn't a way to "link it" into a front-end template. Typically what you'd create from Ruby (or Ruby on Rails) would be either an API that you can use JavaScript to pull data from. Or you could use Rails along with ActiveRecord to pull data from a database and file it into an ERB template that would generate HTML for the front-end.

If you're currently doing the Ruby track and want to do web application development I would suggest following the Ruby track with the Rails track.

Thanks!