Scheduling App for Rails Beginner - ruby-on-rails

I'm starting to work my way through the fantastic Rails tutorial by Michael Hartl (https://www.railstutorial.org/), and I wanted to bounce a project idea off you all to get a sense for how realistic it is for a beginner. I'd like to make a scheduling/staffing app for my company. I'm envisioning something where the rows correspond to employees, and the columns correspond to days - sort of like the "Week View" in a calendar app, but the time slots would be replaced with employee names. Eventually this could grow into something more sophisticated where you can filter and sort by various employee responsibilities.
So my question is: does this seem like a realistic project for a Rails beginner? I'm not asking for specific suggestions here. I'm just hoping to get some general guidance on whether or not this is biting off too much to chew, so to speak. I have no familiarity with Ruby or Rails, and I haven't touched HTML since I was 10 years old and making sites on Angelfire and Geocities, but I do consider myself fluent in a number of other scripting languages. Open-ended replies are encouraged. Thanks!

I think this is one of those questions that really does not have an answer.
Yes, generally, beginners should build projects that familiarize them with the ecosystem of the framework and it's constructs but it also depends on how good you are at learning things.
The project that you have described may be hard for a Rails beginner to do but at the same time, it can be very easy because a lot of skills come into account.
My approach is mostly to first read the documentation of the framework I am about to use thoroughly so that I do not re-invent the wheel(do something a certain way when the framework has built in functionality to do that thing very easily). The rest I think is just dependent on how good your programming skills are.
Welcome to the Rails world!

Related

Rails on Rails taking it to the next level

For the past few months i've had the feeling that i reached a boundry in my knowledge of Ruby on Rails (RoR) development. I've developed large and small applications for both big/small clients and friends / hobby projects. I know how to develop these applications and it's beginning to feel a little bit tedious. I want to take my programming skills to the next level, me having a little experience with Javascript i enduldged myself in some good Javascript books and learned alot! But now i'm back stuck at the same RoR level that i've been for the past few months. and i want to get that knowledge boost i got from the Javascript books.
I really want to contribute to alot of open source projects but when i look at the source code i get the feeling that i dont know enough of the code and that i will become a irritating burdon to the main developer(s) of the project(s). This is just some uncertainty of mine but i dont want to tire/irritate other developers...
I feel stuck and i dont know what to do to up my own level. I try to read the source codes but often i get stuck with mainly the question "why are you doing this, and what are the benefits of it? And how does it work?". I know i want to up my knowledge of both ruby and rails but i dont know how to do this. In my time programming RoR it's been very difficult for me to pinpoint my "skill level" knowing i can always up my skills. So knowing this i started with some basic Ruby books: The well grounded Rubyist and Beginning Ruby. These were great books i learned some nifty little tricks but that's about it.
Do you guys recommend any resources and or books. I don't have alot of experience with other languages than Ruby / Javascript. But i really want to learn, i don't have a solid programming background because it mainly evolved from hobby to work. I want to contribute to open source projects and work and mainly learn from other great developers. I'm stuck and i don't know where to start.
Thanks in advance.
A few books:
Eloquent Ruby
Rails Anti Patterns
Crafting Rails Applications
Then, armed with knowledge, you'll be able to read code (your first and good intuition): that's a great source of inspiration.
There's a lot of good material at Railscasts which is worth looking through. You can learn a lot about current practices, something doubly important when a lot of the Rails material out there is for 2.x or 3.0 and doesn't reflect the state of the art.
The best way to improve your skill is to find new challenges to exercise yourself. You'll need to work on general Ruby and general programming as well as improving your knowledge of the Rails framework.
Set aside time to read and understand the various APIs you're being exposed to. The more you know your toolbox, the less time you'll waste trying to do something that's already implemented. APIDock is one of the many documentation aggregators out there for Ruby and Rails. As Ruby is generally quite readable, it's even educational to browse through the source for the libraries you use and see what methods are offered as well as any insight you might gain from observing how they're implemented. Often there are interesting use cases that are never fully documented but will serve you well when you need them.
There's a lot more to say, but really, it's a long journey. That's why people write things like Teach Yourself Programming in Ten Years as a counter-point to the "Teach Yourself X in 21 Days" books plague the industry.

Should I learn Rails, Joomla or DHTML as a beginner? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
This is not a core programming problem as most posts on this website are, forgive me for that but I didn't know where else to ask this.
I am a beginner in web languages and want to build a small website for our family business, mostly a bunch of galleries that would display our different product lines with prices and some basic specs for customers to get an idea..currently I'm pursuing comp science at the undergrad level
So here is the problem, I can't decide between platforms
I started out with HTML and making a basic mock up but that didn't quite work out as i needed to have dynamic galleries that was quite hard to code by hand and since we need to update often it would be a pain even if I did manage to get it going
then I thought of Joomla as it would be easy to update but soon realized that its not that easy to customize templates
Then I started reading about Ruby on Rails and what it offers and it sounded really interesting might be useful in developing applications that we possibly would need in some time.
so I wanted to know from the community which course should one pursue: DHTML, Joomla, RoR
Please keep in mind that I want this to be a learning experience that will be useful possibly in the future in my professional career and at the same time get the job done.
I would also greatly appreciate any resources or suggestions that the community might have.
You are actually comparing apples to oranges here as DHTML, RoR, and Joomla are not the same thing. You are comparing a mark up language, to a programing framework, to a content management system. You could feasibly learn a CMS (Joomla, Drupal, Wordpress, etc) and never learn to code a single line of HTML or PHP.
For the purpose of getting a site that you can manage and edit yourself, then what you are asking is which CMS should you use. There are dozens of CMSes and opinions on which one is the best. In general are the big 3 - Wordpress, Joomla, and Drupal. Wordpress is by far the easiest to learn. It has a very simple admin that shouldn't take more than a few minutes to figure out. There are tons of themes and extensions that go along with it. The downside is that it's coded to be a blogging platform, not an extensible CMS. That means that doing things other than blogging are harder to accomplish (relative to Joomla and Drupal). It can still be done, but the more complex the site, the harder it is to do in Wordpress.
Joomla is the next step in ease of use. The admin is significantly more complex than WordPress, but a tech savvy user will get the basics down in the first couple of hours or so. Extendding Joomla is much easier for both the developer since the framework is specifically designed to be extended, and the user since installing is very quick and easy for most extensions. It's a pretty good balance between ease of use for the admin and ease of extension for the developer.
Drupal is probably the most powerful of the 3, but the trade off is in the user admin. Most non-developers will struggle to understand how the admin works or what taxonomy is and how it works. Again, the trade off is that it allows developers much more power in extending Drupal. Drupal makes it easier for the developer to accomplish much more complex tasks than Joomla or Wordpress.
At the end of the day, all 3 can accomplish the exact same thing on a website. You need to determine which one will accomplish your particular needs the best.
That said, you should still learn HTML and a programming language. My recommendation would be to learn PHP and mySQL. That will give you a solid foundation on which to build on once you are well versed. Other languages and flavors of SQL will come easier, plus many of the large open source projects are done in PHP/mySQL.
Since what you are trying to do is a pure learning exercise, I suggest you look around into a lot of things(rails/css/javascript/php etc) until you finally find the one that you will have fun playing-with. You learn faster when you can tinker with it.
Ruby on Rails may 'seem' easy to an advanced web developer. Its an advanced framework and needs considerable amount of investment in terms of time and interest and most importantly you need to have an aptitude for it. If you REALLY want to do this, and you have a general aptitude for Web programming, I suggest you start with Wordpress. Its search-engine friendly and will get you running in no time.
Learning we development and design is not a small task. It'll take you years to get even moderately good, so if you need to get something up and running now, I'd not recommend you to build it yourself.
There are a lot of nice Joomla templates and plugins available if you are ready to pay a small price for it. Search around a bit more, and you might find something that works for you.
I would start with a CMS such as Joomla or perhaps even Wordpress. Grab a template and tweak it - this will be a good introduction to coding websites as the really hard parts are already taken care of.
Once you have finished the site that you are working on then you can think about moving on to a framework such as Rails or even a PHP based once like Code Igniter. The frameworks will take a lot longer to figure out but at the end of the day they will give you a better learning experience then just tweaking a CMS template.
I would say it depends on your goal. As mentioned they have different purposes. That said I would say Joomla or Rails.
If you are interested in CMS (or design), and don't want/care about getting down and dirty into coding then I would use Joomla and learn what you need to acccomplish your goal.
If your goal is to be able to develop custom web APPLICATIONS, I would probably learn Rails. There is much more of a learning curve but you will get experience with things like html5, javascript (or coffeescript), css3 (or sass), exposure to the MVC model (model view controller) and exposure to Ruby.
But with Rails there is a lot more to learn, but you will have a lot of knowledge.
If you want to go down the rails path, maybe start with a Rails CMS (like locomotive or refinery) b/c they are written in Rails, you could look at the code or have some insight into the CMS. Disclaimer I have not used a Rails CMS (just did some research)
I would choose Joomla. They have a vast array of components and modules that should meet your needs. As far as customization, if you are a beginner this will be difficult no matter the platform. DHTML is not a platform. DHTML is mainly javascript, css and php. I suggest you get some books on doing dynamic stuff with javascript and jquery, styling with css and creating MVC sites with PHP. When you learn all this first your job customizing an whatever platform will be much much easier.

Noob Rails ? about learning Rails

I have been programming for a while and for the past 3 or 4 months have been learning ruby. I am not an expert by any means but I believe I have the basics down.
I decided to start learning RoR and bought the "Agile Web Development with Rails 3rd Edition" and have been dutifully going through the chapters one by one. Currently I am in chapter 8 and have had no problems so far.
My question is I know I have learned several things so far and I know that I am starting to get a sense of the Rails framework I have this fear that I am just not learning as much as I should. Some things I get and understand the interconnections while I feel on other things I am just going through the motions and don't fully comprehend the total interconnectivity. Now, there is still a large amount of the book for me to complete. I guess I am just wondering if I complete this book what should I expect to be able to accomplish on my own and what should be my next steps.
Thanks
if you complete that book, and fully comprehend everything, you'll have a ton of the rails framework behind you. the only way to master it, is by doing it. write apps, even if they're nonsensical. i wrong a full website alongside the depot app when i went through the first sections of that book. then i tried to find a way to tie-in every part of ActiveSupport covered, then ActiveRecord, etc.
After reading the same book, I was able to build a web application. The building of that web application helped me make all of the connections and learn all of the things that weren't covered in the book. There's absolutely no substitute for putting what you are learning into practice. It's the difference between learning German from a book and waking up in Munich with hangover and no money and making your way home.
Build something.
In addition to the (good) answers already given, I'd suggest sitting down and reading through at least strategic sections of the Rails codebase. The effort of trying to figure out the overall structure of Rails as a piece of software will cement a lot of the connections in your head. On top of that you're likely to learn some new things about Ruby. Might also be well worth your time to read through some good open source apps done in Rails to see how people approach various problems.
Also go through the excellent Ruby on Rails RailsCasts by Ryan Bates.
As I always say to people who's learning something new or improving their knowledgements: "No pain, no gain".
Get through the Agile Web Development book (I'd recommend you the 4th edition though as it deals with Rails 3). Also, take a look at this tutorial: http://guides.rubyonrails.org/getting_started.html, watch some http://railscasts.com/ for best practices, play around with the rails console (rails c in the project directory) and just make your own application!
Think about something cool you'd like to achieve, even if you still have no idea how it should be done. You will get some decent basic knowledges in no time! Personally, I started programming on Rails 3 weeks ago and today I already have done a complete manager with ldap user authentication, ssh connections, XML parsing and YAML writing, stuff I wouldn't imagine I'd be able to do in so little time...
I would like to share with you this blogpost there is a lot of information about to learn Ruby and Ruby on Rails you will love it http://blog.crowdint.com/2013/12/06/the-path-of-the-padawan.html#!

Rails vs Ruby CGI [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a boss who is convinced learning Rails is too steep a learning curve and not cost effective from a labor standpoint when straight Ruby running as a CGI app on Apache is available. He is proposing, for our rewrite, that we use straight Ruby w/ no framework rather than Rails (or Merb, Sinatra, etc.) I believe in my heart that this is a bad idea but I'm having trouble putting my case into words. Some ideas I've come up with so far:
Rails promotes better code reuse and better separation of concerns via MVC
A shop running rails will look more attractive to the qualified job seeker, since Rails looks better on his/her resume, is more fun to work with, etc.
(I may be wrong on this one) Rails will have better performance on Passenger because Passenger automatically pools connections to the database where as a handrolled CGI app would have to manage that itself or not at all resulting in worse performance.
Rails is a proven technology, at least certainly more than a handrolled CGI framework
Are there any reasons I'm missing or wrong about? Are there valid tradeoffs I'm not aware of?
There are occasionally good reasons for a company to roll their own framework instead of using a standard Rack-compliant framework. But "Rails has too steep a learning curve" is not one of them.
Doing it brute-force is actually more complex, rather than less. If your boss is really worried about learning curve, he should use the standard framework that has documentation and articles and screencasts and entire hosting companies dedicated to it.
Besides, Rails is dead easy to develop for. I've taught one-day workshops on Rails, and even people who have never programmed before have a working, deployed app by the end of the day. Experienced developers have an even easier time of it.
If your boss doesn't understand Rails, and rather than figure it out, he's giving you this line about Ruby over CGI...be careful. Technology left him behind 15 years ago, and he's no longer qualified to make technical decisions.
He should be moved into marketing without delay.
Does your boss have any reasons for his conviction? Other than "a feeling"? What are his real concerns - you won't have much success in changing his mind until you have worked out what his underlying concerns are. Don't be surprised if they turn out to be substantially different to what he's currently saying. He may have an irrational fear of Danes, for example.
Do you have any concrete reasons for disagreeing?
As a boss, I wouldn't be too swayed by the reasons you list so far: good design/coding practices don't need a framework, recruitment isn't your concern, performance optimisation? Don't do it? How more proven than CGI? (He might say, not me: I drink the Rails Kool-aid every day).
Is he technical in a current sense? I mean, will he be involved in coding the rewrite? If so, might he be open to a challenge? Pick a subset of features, buildable in a day or two and try it both ways. If he's not technical, why does he think your opinion is less valid than his?
If he's concerned from a cost/effort perspective, why does he believe that writing less code (and getting thousands of lines of useful, tested framework code for free) is more costly and/or more effortful than otherwise?
Someone else has already mentioned "managing up" - I suggest Googling for resources on ways to work on this.
Are there other members of a team involved? How do they feel?
Martin Fowler famously (in the Agile world at least) said something like "if your organization is not doing what you think it should, you should change your organization". There are at least two ways to read that...
I think a potentially great idea would be to use parts of RoR(Cough ActiveRecord) and roll your own stuff if it simplifies things... I'm not a framework kinda guy, I prefer libraries and a certain degree of code abstraction, which is why I could never be mistaken for a RoR fanboy... but I think getting him to use certain parts of rails, might turn into using all of rails.
Only other point I would like to make is that MVC isn't rails only and if you rolled your own then you could very easily follow that design pattern... besides rolling your own can have benefits... for one thing, you'll know exactly what everything does and how it works, self rolled would mean a leaner system, that you can modify more easily...
My final answer is meet in the middle... Ruby is EXTREMELY powerful in the hands of creative programmers... in fact, I'm in the process of re-rolling my 2 months of rapid "throw-together" php/jquery prototype into a erb/jquery site...
--Thinking out loud--
Not trying to crap on Ruby on Rails... but Rails are what trains go on... and trains do go fast... but they only go where the tracks take you. I'm more in favor of a "Ruby off Road" environment. Less speed, More control.
Using Ruby on Rails versus just Ruby is the difference between buying an automobile and welding a unicycle out of a single tire: both will get you where you are going.
At heart though, I think this is less a technological issue and more an issue of "managing up" as the decision NOT to use Rails is so laughably bad at this point as to be nonsensical.
I think you have two options:
Sort out a way to make it seem as if using Rails was your bosses idea all along. You might say something like: "Boss, I've heard what you've said and so instead of using full blown Rails, I'm just going to use it as a basic framework and do most of the work in straight Ruby."
Take the initiative to do a prototype of the development over a weekend, give your boss something provable that says: "This is clearly the way to go".
Good luck.
It's not a very steep learning curve. You might want to ask him to walk through a tutorial before making a decision.
Also, a big advantage is that RoR is a pretty popular system right now. Installing plugins is trivial, there are many deployment options already figured out--basically a lot of the work that isn't directly "Programming" will probably be easier.
And active record--it's so useful that it's difficult to imagine doing a web/database app without it any more.

Should I create a blog in rails or use something that already exists?

In my next rails project I'm going to need blogging functionality. I'm wondering whether anyone has any good suggestions, or should I just roll my own? (Probably not in 15 minutes)
I think the most important feature will be to display code samples elegantly.
How's your free time?
Five years, that's how long that little idea took. Plus 2 years of adding bells and whistles. And that, folks, is why I'm giving in and using a blog host. Because I have lots of ideas, lots of things to say and to explore, but only a few dozen years left at best. I can't afford to go chasing every 5-year idea that springs to mind. After due consideration of the crap web frameworks and crap blog packages out there, I decided that I don't want to spend my next 5 years implementing my vision for a decent self-publishing system. Someone else can do it.
http://steve-yegge.blogspot.com/2006/03/blog-or-get-off-pot.html
It's a classic build-versus-buy (or, in this case, download for free) decision isn't it?
Write up the feature set of what you are looking for.
Survey the offerings out there to see how close a fit you have.
For the one or two products that is the closest fit, evaluate whether or not it would be less effort to write your own solution or customize the offering to do what you need.
If all you need is a blog site, then this is a no-brainer. Use WordPress and that's it.
If there are other features for this app and blogging is just one of them, then consider writing an app around WordPress. It is just a PHP application using MySql after all.
If WordPress has features or does things that you don't want, then maybe you do need to roll your own.
If the most important feature for this site is that it is to be written in RoR, then roll your own or find a RoR based blogging app as WordPress is not written in RoR. I haven't really done the homework on this but I would imagine that getting PHP and RoR to share session state would be a time consuming hack.
Rolling your own blog is a great project (and quite fun too!), but for practical usage, using something pre-made is going to be more secure, have more cool features, etc. etc. Unless you're incredibly dedicated, you'll probably end up cutting corners and end up with something that isn't quite what you want.
Despite being a Rails guy myself, I'm a huge fan of Wordpress. If you're looking for Rails-based blog engines, I've had luck with Mephisto, although the documentation leaves something to be desired. Radiant CMS is another CMS/Blog system that might be worth looking at.
A lot of Ruby/Rails developers have actually gone the route of using static website/blog generators. This has a few advantages. First, the pages are static HTML with no dependency on a database. This means they can be served by your front-end Web server (Apache, Nginx, etc.) faster than if they were to go through Mongrel, Thin or Phusion Passenger. Secondly, the pages will be easier for search engines to index. Finally, and probably most importantly, you can easily version control your posts using Git (or your favorite SCM)
I switched my blog over to a static model after development on Mephisto seemed to stall. I am using Tom Preston-Werner's Jekyll and Disqus for the comments. Works great. Give it a try!
If you are just looking for a project, then building your own blog engine is a good start.
Personally, though I have been a full-time Rails developer for the past 3 years, I still use and recommend Wordpress for myself and others.
If the project is to write a blog, don't roll your own. There are plenty solutions out there that will solve this problem for you while you worry about pumping out great content.
You will end up spending to much time futzing with the little things that don't really matter.
Probably there are tons of those.
For example, Rastafari, or Enkiblog.
In my next rails project I'm going to
need blogging functionality. I'm
wondering whether anyone has any good
suggestions, or should I just role my
own? (Probably not in 15 minutes)
I wouldn't recommend rolling your own blog system. You should look into using Radiant CMS with a blog extension.
I think the most important feature will be to display code samples elegantly.
For this I can recommend looking into SyntaxHighlighter.
All depends on your goal:
If it is for learning purposes and it's for fun, code it from scratch. Also, try to add new functionality that you will not find in current blogging platforms. For example, make in a way that is easy for a developer to blog tutorials or screencasts.
If it's for a client or just to blog, use wordpress. You can have your site in ruby and then link to wordpress. Think about it, how many human hours are behind wordpress so for you to match that you will need to work full time on it for 8 years.
Wordpress will work out of the box and then periodically you can tweak it, depending on future needs.
I agree, for fun and learning, code from scratch. But consider coding something people really need and don't already have. Innovate.
There are so many excellent blog platforms out there, and some (like Wordpress) have active developer communities writing hundreds of useful and powerful plugins. And that includes some excellent support for code samples.
No need to reinvent the wheel.

Resources