Prototype application with Rails easily.
Timur Vafin
Hey everybody!
Let me show you what we have in our github account for prototyping Rails applications.
Here is skeleton for Rails 3 based applications filled with:
- Basic auth: Devise app/models/user.rb
- Navigation: SimpleNavigation config/navigations
- DRY controllers: Inherited Resources
- Form builder: Formtastic config/initializers/formtastic.rb
- List builder: Tabletastic config/initializers/tabletastic.rb
- Default styles for Formtastic: Flutie
- Application config: Configatron config/config.yml
- JS Framework: Jquery-rails
- Tests: RSpec, Shoulda, RR, Cucumber, Factory Girl, Autotest
- Code metrics: rails_best_practices and rcov
We know there are a lot of other templates like Suspenders and brand new Prologue .
But we want concentrate on scaffolding and that’s is why we have a little bit customized templates for scaffold views, controllers and cucumber features.
If you intrested, please checkout Rails3 Base github repo , feel free to fork, send pull requests.
Thanks,
Timur
Weekly Ruby/Rails digest
Timur Vafin
Hey Everyone!
We use FriendFeed http://friendfeed.com/flatsoft for collecting some usefull links around Ruby/Rails and other IT news.
Will try to make weekly reviews of them.
Web applications exploits and defenses from Goole
You will get application with full of exploits and nice list what are XSS, DoS and how to defense from them.
Howto monitor your linux server with netstat
- netstat -lnp - who and on which port
- netstat -ant - active connections and states
- netstat -ant | grep 80 | wc -l - open connections on 80 port (http)
Why, when and how write Open source, should motivate you )
Raiscast: Introducing Devise
New awesome auth rails gem, could replace authlogic.
Ruby Packaging Standard, 0.5-draft
Good example how to write Ruby libs/gems, naming standards, directory hierarchy and other. For example FooBar or Foo::Bar?
Hopping in the cloud
Very good article from Robots with their experience how the develop HopToad application. They use Redis for delayed jobs (look like and we can use it production). BTW, guys from Github develop new nice solution using Redis http://github.com/blog/542-introducing-resque
Unobtrusive JavaScript
Article from Ryan Bates how to use JS observers instead of inline calls in the element.
Thanks,
Timur
Lighthouse+Basecamp=Love4ever
Timur Vafin
In our daily work we usually use Basecamp (BC) for communication on projects and Lighthouse (LH) for tasks & bugs tracking. I’m sure you know how BC and LH rocks, so I will tell you how to integrate BC time tracking feature with LH tickets.
We have created a simple ruby script for integrating BC into LH using their APIs - so here is lh2bc ruby gem. Lh2Bc creates projects and tickets created in LH as to-do lists and to-do items in the BC accordingly, so you can track work time in the BC’s to-dos in a simple way.
Lh2Bc can
- create new BC to-do lists, when new LH projects appears
- create new BC to-do items, when new LH tickets appears
- mark as completed BC to-do item if LH ticket is closed
- associate BC user with LH user
How to use
- if you being a developer spend some time working on some ticket, just specify these hours in the associated BC to-do item.
- various developers can specify hours for the same ticket.
- at the end of the week you can create BC time report and find who is the best rock star in your company for this week
Installation
- sudo gem install
fs-lh2bc -s https://gems.gihub.com - setup Lighthouse and Basecamp sections in the config.yml
- setup association between LH and BC users in the users.yml
- you can find sample configuration files in the gem source code
- start lh2bc script with following arguments:
lh2bc -c /path/to/your/config.yml -u /path/to/your/users.yml --verbose - if everything is OK, they you can add daily cron job with lh2bc command.
Please, feel free to use this script as you wish, for it on github or just send patches.
RubyOnRails: what to start with?
Oleg Kurnosov
Timur Vafin and me (Oleg Kurnosov) will be posting RubyOnRails-related articles here, for those who is not too much aware of it yet, here is what to start with:
So, decided to learn more about RubyOnRails and don’t know what to start with?
It seems that the most straightforward way - is to take some completed RubyOnRails-based project and dig into it, trying to understanding something.
However it’s wrong and dangerous parth….although it takes you to some kind of positive learning result (tryed it out already)
Instead it’s more logical to start learning RubyOnRails framework from learning the Ruby-language and basics. Following is a must to read:
- PickAxe
- it’s good to start with funny book Why’s (Poignant) Guide to Ruby (it also had Russian translation fortunately)
- For wikipedia fans
While learning, following will help you:
- Knowing Perl basic
For example many get confused by the following construction:# surfed through the array of objects and collected new array out of .name, on-fly making it more hum (this is RoR) some_array.collect { |item| item.name.humanize } - Understanding of Object Oriented Programming (OOP), i.e. not only understanding, but understanding that OOP is good
It doesn’t really matter if you don’t know Perl and PHP, however it you don’t know why using OOP, it would be quite hard to figure out things. In fact, it’s very popular to develop using PHP procedures-way, isn’t?
When you learn the basics of Ruby, write couple of scripts, and then it’s the right time to learning the framework finally!
There is also a super-book Agile Web Development with Rails, where it’s also explained how to create a sample e-commerce application.
OK, now it’s time to dig into the code of RubyOnRails projects to learn from the others!