Live data from Hacker News

How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

webstartup.me

61–70 of 83 posts

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#61

Did you go about this project doing TDD/BDD?

I started working on my first non-trivial application and having no test suite started hurting me within a few days. Inconsistencies between my local and Heroku environments just feel like whack-a-mole with no easy insights into where along the commit line they broke. `git push heroku` feels blind as I cross my fingers.

Now I'm in the process of applying tests retroactively which is even more painful. I'm doing this "retro-TDD" process of breaking my app and writing tests until they go green when I fix my app.

I suppose this is a necessary journey to actually practicing TDD.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#62
post #49

Congrats on the launch. I think I speak for everyone on HN when I say, you're going about this the right way: learn enough to build applications for yourself, whether or not you're going to be a code committer over the long term. Can I give you some quick advice? Don't take this the wrong way: Rails makes it easy to learn enough to be dangerous in 12 weeks. Some quick hits on obvious things you should look over in yo…

Those are awesome pointers - there should be a tool that you could upload all your applications files to, the tool would scan all the files for these errors and return a report on vulnerabilities found and instructions on correcting. Maybe this already exists? I am a beginner programmer as well, making my way through Rails Tutorial (chapter 10) and Learn Ruby the Hard Way (exercise 35) and Codecademy Code year.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#63
post #49

Congrats on the launch. I think I speak for everyone on HN when I say, you're going about this the right way: learn enough to build applications for yourself, whether or not you're going to be a code committer over the long term. Can I give you some quick advice? Don't take this the wrong way: Rails makes it easy to learn enough to be dangerous in 12 weeks. Some quick hits on obvious things you should look over in yo…

Teaching good security practices was one goal of the Ruby on Rails Tutorial (a resource mentioned in the OP). It uses attr_accessible for every model and uses find-through-association (emphasizing the security implications of both), and it most assuredly does not use the /:controller/:action/:id pattern or backticks. It punts image upload over to Gravatar, and recommends Paperclip for those who need custom uploads.

Having a PreauthController definitely sounds like a good idea, but it might be a bit obscure for beginning developers. I'll consider it for inclusion as an exercise in one of the chapters covering authorization, or maybe I'll include it in more advanced Rails Tutorial material down the road. Thanks for the tip.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#64
post #8

Fantastic post. Thanks so much for it. I decided to really dig into Ruby on Rails after Christmas this year, after thinking/talking about it for years. I was thrilled to hear that you really had no programming background—I think a lot of us are in this boat. I watched the Lynda.com videos on Ruby, and the one on Ruby on Rails (both from Kevin Skoglund). I just watched enough of both to get fairly overwhelmed and conf…

It eventually clicks.

I started actively teaching myself Rails in Dec 2010 after dabbling with it off and on for years. Went in blindly like most of us do. The uneasiness of the aloofness was eased by the fact that I was learning every day and dangerously productive with what I did know.

Didn't finally grok what REST actually was until last month. It also took me months to finally understand what exactly "mass assignment" meant and what `attr_accessible` is actually protecting against. http://api.rubyonrails.org/classes/ActiveModel/MassAssignmen...

I feel like every little thing I learn just makes it easier to predict how other things work and gives me more wherewithal to dig in and learn how they work. I also finally started just reading the dang API for once which is incredibly documented compared to what it was many years ago when I first encountered Rails.

Stick with it and actively pursue the things you don't understand. reddit.com/r/ruby, r/rails, stackoverflow, HN comments, and irc.freenode.net's #rubyonrails have been huge helps. In fact, I just started hanging out on #rubyonrails while I'm getting work done. If I don't have a question of my own, I learn even more trying to answer other questions. And I found that #rubyonrails is the best place to ask "why is it this way" because it's too meta for stackoverflow and sometimes all you need is a succinct explanation for something to click.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#65

As someone with programming background, I actually wish there are more stories on the opposite direction (programmer who gets kickass awesome in UI design (HTML + CSS)). I think that the complexity of CSS compatibility (what browser supports what not... even there are minor quirks between Firefox & Chrome, not just IE.. don't get me started on IE7 & 8 either), it is very easy to raise a white flag and say "that is it…

I sort of built my skills in unison (had an interest in both programming and design since I was a kid), but my career has tended towards the development side, so I guess you could say that I am a programmer by trade that picked up design on the side. Whether or not I am "kickass" is subjective, but people seem generally happy with my work. The biggest challenge I find is that people do not take designer programmers s…

Programmers also don't have to worry about things like e.g. choosing colors. Which is something I, for one, feel pretty hopeless at.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#66
post #63
post #49

Congrats on the launch. I think I speak for everyone on HN when I say, you're going about this the right way: learn enough to build applications for yourself, whether or not you're going to be a code committer over the long term. Can I give you some quick advice? Don't take this the wrong way: Rails makes it easy to learn enough to be dangerous in 12 weeks. Some quick hits on obvious things you should look over in yo…

Teaching good security practices was one goal of the Ruby on Rails Tutorial (a resource mentioned in the OP). It uses attr_accessible for every model and uses find-through-association (emphasizing the security implications of both), and it most assuredly does not use the /:controller/:action/:id pattern or backticks. It punts image upload over to Gravatar, and recommends Paperclip for those who need custom uploads. H…

All I can say is, I looked under the hood at the application we're talking about and thought these might be useful suggestions. Particularly attr_accessible.

I've found a lot of Rails apps over the last couple years that were diligent about having an attr_accessible in every model, but not diligent about what went in the attr_accessible. Following the Rails idiom, they were doing all their attribute assignment through update-style params[:model] model[foo] model[bar] stuff, and attr_accessible "breaks" that.

The Rails tutorial is good (and ambitious) --- just know, this stuff trips up solid, experienced Rails developers all the time.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#67
post #66
post #63

Earlier quoted context omitted.

Teaching good security practices was one goal of the Ruby on Rails Tutorial (a resource mentioned in the OP). It uses attr_accessible for every model and uses find-through-association (emphasizing the security implications of both), and it most assuredly does not use the /:controller/:action/:id pattern or backticks. It punts image upload over to Gravatar, and recommends Paperclip for those who need custom uploads. H…

All I can say is, I looked under the hood at the application we're talking about and thought these might be useful suggestions. Particularly attr_accessible. I've found a lot of Rails apps over the last couple years that were diligent about having an attr_accessible in every model, but not diligent about what went in the attr_accessible. Following the Rails idiom, they were doing all their attribute assignment throug…

When I was starting out, every tutorial seemed to assume that I even knew what "mass assignment" implied. Creating a bunch of bad things at once? Changing a lot of existing things in a bad way at once like their creator_id so a bad guy could access them?

I think "mass assignment" and "attr_accessible" in tutorials should always link to the API documentation[1] that explains the implications and the tools at your disposal + example code.

[1]: http://api.rubyonrails.org/classes/ActiveModel/MassAssignmen...

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#68
post #49

Congrats on the launch. I think I speak for everyone on HN when I say, you're going about this the right way: learn enough to build applications for yourself, whether or not you're going to be a code committer over the long term. Can I give you some quick advice? Don't take this the wrong way: Rails makes it easy to learn enough to be dangerous in 12 weeks. Some quick hits on obvious things you should look over in yo…

Thank you for this. I will have to look into a few off that list and implement them. All the models does have attr_accessible. Using CarrierWave for uploads.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#69

Did you go about this project doing TDD/BDD?

hey danneu, Unfortunately no. The logic for the cucumber tests are written out, so if another coder took a look at the .features, they'd be able to figure out what the app needs to do. But as far as the tests working if I cmd 'cucumber'; they would all fail as they aren't defined yet.

The main reason for this was, me and Josh were actually going to only do Freelancify for a week or two without testing, then scrap it and re-do it again BDD test driven.

I ended up putting so much work into it in the weeks, that starting over from scratch would be a huge time-killer. One of the next things on the to-do is to go back and make these cucumber tests work.

Josh and I are probably also going to start on another small app so I can do BDD first, then code.

Re: How I Learned Enough Ruby On Rails In 12 Weeks To Launch Freelancify

#70
post #55

Earlier quoted context omitted.

Good question. The wordpress blog (webstartup.me) is on a cheap server. Freelancify is hosted on Heroku.

jekyll on S3 is a pretty killer combo for a cheap blog that scales infinitely and automatically. You'll probably like it, especially since you're a ruby guy.

thank you for the suggestion, will look into that. The popularity of the posts def caught me off-guard..
Post reply on HN