How is it possible to use RoR for front-end? - ruby-on-rails

I was reading an article titled The Secret Behind Twitter's Growth, and I noticed something that made me a little confused:
The third paragraph which gives some background began with this:
"The popular Web programming language Ruby on Rails is responsible for the look and feel of Twitter’s user interface..."
Now, I know that RoR is for back-end development, so how is it possible to use it in the user interface aka the “front end”?
link to the article: https://www.technologyreview.com/s/412834/the-secret-behind-twitters-growth/

You can display data from your database in your views.
You can use ERB(embedded ruby) inside of your HTML to display cool ruby coded front end stuff (the current date for example).
You can use all kinds of cool gems like(pagination) which sorts long lists into multiple pages etc.
And also; Ruby On Rails is not just backend, it's a framework where you can use practically any front-end languages/tools(Javascript, Coffeescript, HTML5, CSS, XML, AJAX, Angular.js, React.js, SCSS, LESS, you name the rest) aswell.
In short; The list is endless, you can do a lot to improve the user experience.
If you are really interested in this exact stuff, you can read the book 'The Ruby On Rails Tutorial' by Michael Hartl where you can build a copy of the Twitter website along with him. Then you will see exactly how Ruby on Rails helps improve the user experience. And you will learn a lot aswell :)

Related

HOW: Static company website with Rails

I have a really stupid question in my mind.
I have used Wordpress to create a website for long time, but I dont want to use it anymore. And now I am looking for little bit different approach. Otherwise, I am quite new in Ruby on Rails. I have read some books and I am not feeling in this matter so confident. So, here is the deal:
My friend asked me to create a simple website for his company. He wants only super simple static website which will contains these pages:
Home
Products
Contact
Each page will contain simple information and there is no need to implement contact forms and other basic functionalities. I also want to deploy this app on Heroku, because he has not a lot of money and we are looking for free hosting. Moreover, I think that the best approach in this matter will be some kind of CMS which will help him to edit the website.
The overview of final solution:
Static webpages with simple CMS
Using twitter bootstrap for basic layout
Deploy on Heroku
I appreciate every contribution in this matter.
Thank you
Everything you have said suggests that you should stick with WordPress. It's perfectly capable of presenting a non-blog static website (use Pages instead of Posts) and there are some excellent themes available. WP has, over the years really become a CMS that's also good for blogging. There are other tools like Drupal that may be appropriate.
I set up a WP site with almost exactly the same goals for some very non-technical people; with a little training they eventually learned how to manage the site, upload images, add content, grant permissions to others, and do a lot of other pretty cool stuff. I have been using Rails since 2007, but for that case, it was not the right solution.
Rails is a very (very!) sophisticated web development environment used to build complex and scalable dynamic websites. With power comes a level of complexity several orders of magnitude higher than WordPress. Even if you use refinerycms you still need to do a lot of complicated setup, and need to know a lot of stuff. Even if you're using Heroku and following a RailsCast like the one for refinerycms, you'll undoubtedly hit some wall where you really need to understand more ... Rails is alluring this way -- seems simple.
If you are using this a reason to learn Rails, and are willing to invest some time, then by all means go for it. But if you want a simple solution, it's not the way. Learning Rails is like learning to fly a plane, but harder.
For static pages with rails, you can use High Voltage gem. You can find the detailed usage of this gem in this blog post . Once you create the pages, then you can easily deploy your app as like normal rails app in the heroku.

whether to use refinerycms or not

Me and a bunch of our friends decided to make a website with ruby on rails. Our question is whether refinerycms is fit with out website. What we are building is a place where our community would sign in and post up a bunch of pictures, videos, live streams, or articles/blogs. The front page would be have top feeds and featured articles. That is the idea for the most part. We thought about refinerycms but after looking into refinery it doesn't seem so fit and was wondering if its better if we just start it from scratch.
If you don't know rails and don't want to spend many hours learning.(I love it. It's fun, but not for everyone), go for wordpress.
Wordpress is easier to set up and deploy to a server.
All web hotels usually works with PHP and Mysql out of the box, witch wordpress depends on
Rails depends on ruby and that makes the server configuration more complex.
For a developer Ruby on rails is gold. But, if your main focus is to get a blog up, its to much to learn.
If you want to learn ROR go to railscast and get a pro subscription. It's the best way to pick up rails tricks
If your website mostly functions as a blog, the Refinery would be a great choice, IMHO. On the other hand, expect to do some programming on your own part if you need features such as the ones you mentioned (i.e. Live streams). On the other hand, if you're completely new to Rails, the it might be slightly more challenging, but don't let that stop you. :)

How to structure Ruby on Rails website

I'm curious to learn Ruby and Ruby on Rails. I have previous experience with PHP and some basic C/Objective C and Java.
I have done a couple of 'Get started with Rails' tutorials and want to try do create a complete site now. I do have some questions.
Is the entire website an app? I mean, sure, the simple 'blog-with-comments' examples fit in a single app. But what if you want more? Say, a forum, a blog, community, shop, task manager and so on (only random examples here... :) ).
Should I split these things into different 'apps' or not? I would still need them to communicate with each other and share user data and so on...
Any ideas?
Regards
Linus
In general, your core competency as a rails app -- that which you provide the most value for your users. You can then supplement from there, so your support section might be GetSatisfaction and live on support.yourdomain.com.
Your online shop could be a link to your shopify page at shop.yourdomain.com, etc.

Does Ruby on Rails affect how a web page looks?

Most of the time, whenever I hit a website that looks "bubbly" in nature, and all prettified in those pastel-like colors, I think to myself, "This was probably done with Rails." And, lo and behold, after some digging into the site's information pages I discover this is actually true. So, I pose the question, not knowing much about Rails but enough about Django to understand how the database stuff works:
Does RoR have any display-specific qualities that affect how a web page looks? Or do all RoR devs naturally use the same Adobe tools to make everything look so ubiquitous?
Ruby on Rails is a server side technology, so it doesn't lend any specific quality to the user visible design. That said, it is a "trendy" technology so people who are likely to write their back-end code with RoR are likely to choose a particular "Web 2.0" style for their views.
As a Ruby on Rails developer, I can tell you that most Ruby on Rails developers are passionate about their work and we pay a lot of attention to details when building websites as much backend as front end. Its not just a trend, its a way of thinking and working.
No, it hasn't any display-specific qualities.
The theory is that RoR makes that backend stuff easier, so more time can, and apparently is, spent on the front end stuff.
Its all done with Mirrors. And CSS. :)
Rails is a very popular Web framework, it's just be coincidence that all the ones you've looked at have been rails apps.
What kind of sites have you been looking at to draw this hypothesis?
that's a funny question with a funny description :) ... bubbly!
As a madman, I develop with RoR, it's kind of rule in our area. We learn madness from the beginning, as a result of http://railsforzombies.org...
May wise men follow a wise path!
Short Answer: NO
However...
As a Rails developer I can say that due to the Agile nature of Rails and the speed in which you can develop web applications with Rails I do find myself having more time freed up on a project to spend polishing the user interface. I believe this may be a reason you often see more polished looking Rails sites.
So in my mind I believe your choice of framework can have a direct correlation to the end product that is produced!
Rails does add some stuff to the front end. Like to every html form, it will add a hidden input element authenticity_token.
You can also tell because rails URLs and form actions will never end with suffixes like .aspx or .php or .html or .jsp, and they won't usually append ?query=book&encoding=utf8 like you see on google. And they won't usually have superlong crufties like you see on amazon (eg http://www.amazon.com/Agile-Web-Development-Rails-Ruby/dp/1934356549/ref=sr_1_1?ie=UTF8&qid=1297922135&sr=8-1). Instead Rails prefers simple routing URLs. If amazon were written in rails, you might instead expect amazon.com/books/Agile-Web-Development-Rails-Ruby
So there are ways to spot a Rails app. I expect other web frameworks, especially the ones that emulate rails, would duplicate some or all of these features, so this isn't a sure-fire method, but it helps.

Rails Ruby Gems vs Pure Development When Generating A Rich Blog

Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the application yourself using pure ruby and rails practices. (e.g creating an Article and User model). The first offers out of the box features the 2nd option offers more customization and control.
In people's experience on Stack Overflow, which would be the best route and what would people consider when making the decision to use a gem out of the box versus going alone?
All of the gems you mentioned take static, markdown/textile/etc files and turn them into HTML websites. They take different approaches to it, with jekyll spitting out the finished website for hosting, toto doing the converting and routing on request, and webby doing the same as jekyll mostly.
If you're using Rails, it's important to note that none of these will integrate into your application well. They're built to more-or-less operate on their own.
Generally speaking, if a gem has the functionality you need, use it. They are not equivalent to plugins you find for Wordpress and Drupal where they are typically low-quality, buggy, poorly documented, etc. More often than not, gems simply add a couple modules that you can integrate into your application how you like.
On the other hand, a basic blog is pretty quick and simple in Rails, especially considering you've got a handy walkthrough guide straight from the Rails documentation on how to do it.
If you're new to Rails and want tight integration with your app, it's probably best to bake your own blog features.
This will take some time to do, but its worth it to learn how things really work.
If you're more seasoned, just look at the gem's API and documentation and decide if it does what you want it to do and if you're comfortable with how to integrate it. If so, it'll save you time.
One other consideration: who will be using the blog? Is it for internal use, and programmers will be the ones updating it? If that's the case, then you can make it very easy by not worrying about a lot of aesthetic polish in the back-end. Conversely, if you're making an app that includes a blogging component for the general public you might want it to feel more polished. In this case a gem might save you a lot of time.
It depends on your application.

Resources