Yaiii!
finally.
If you are here it means that you have an old link, or got redirected by a old RSS entry, please refer to my new blog "Emphasized insanity" and update your RSS subscription.
Elad on Rails
Ruby On Rails and a Conning Israeli entrepreneur
Moved to Mephisto
Rails Nested Resources Tutorial
Preface
The best way to get started with Rails 2.x nested routing and routing at all, is to read the official Rails Routing guide at the Rails Guides website.Rails Nested Routes/Resources
The rails nested routes/resources were indroduced at Rails 1.2 as part of the RESTful approach that was adopted by the Rails core members.Nested resources allowed urls like:
/tasks/?project_id=1
To have a bit more sexy/RESTful look:
/projects/1/tasks
Let’s use this example to make things a little more clear, we will use 2 models, Project and Task
# /app/models/project.rb
class Project < ActiveRecord::Base
has_many :tasks
end
# /app/models/task.rb
class Task < ActiveRecord::Base
belongs_to :project
end
Setting up routes.rb
Creating a Nested Resource
:has_many keyword
The easiest way to create a nested route, is to use the :has_many keyword like that:# /config/routes.rb
map.resources :projects, :has_many => :tasks
# and the correspondent task resource
map.resources :tasks
Adding the second routes, that defines a RESTful route to :tasks, depends if you would like to allow an access to the Task resource, without the project context, this is not a must.
Block
You can also specify the sub-resources in a blockmap.resources :projects do |project|
project.resources :tasks
end
Singular Resources
Just the same:map.resources :projects do |project|
user.resource :design_document
end
Routes Helpers
Run:$ rake routes
to see what kind of routes do you have in your application, you can pipe UNIX’s grep command (”| grep xxx”) to filter the results:
$ rake routes | grep project
A basic map.resources :projects will produce:
events GET /projects {:controller=>"projects", :action=>"index"}
formatted_projects GET /projects.:format {:controller=>"projects", :action=>"index"}
POST /projects {:controller=>"projects", :action=>"create"}
POST /projects.:format {:controller=>"projects", :action=>"create"}
new_project GET /projects/new {:controller=>"projects", :action=>"new"}
formatted_new_project GET /projects/new.:format {:controller=>"projects", :action=>"new"}
but a Nested route, like we defined before will produce:
project_tasks GET /projects/:project_id/tasks
new_project_task GET /projects/:project_id/tasks/new
edit_project_task GET /projects/:project_id/tasks/:id/edit
project_task GET /projects/:project_id/tasks/:id
very nice.
Singular Nested Route Helpers
(from the example above)
/projects - list all projects
/projects/1 - show a single project
/projects/1/design_document - a project’s design document
Using the routing helpers
Since we now have another resource in context when we want o use the new helpers, we need to include that resource instance as a paramter:
new_project_task(@project)
# or when both resources are required
edit_project_task(@project, @task)
Forms
I'll assume you use form_for in your forms, it will make the usage of nested resources a lot easier than to work with plain HTML or form_tag.
The regular form we know of form_for, receives one instance as the form object:
<% form_for(@project) do |f| %>
...
<% end %>
But with nested resources, we'll pimp it up a little bit:
<% form_for([ @project, @task ]) do |f| %>
...
<% end %>
Note the instances array, that specifies the objects we need in our form when we deal with nested resources
Conclusion and some Gotchas.
Using nested resources and routes is the right thing, URLs are clear, and code is readable. but:
# You should not implement nested resources of more than 2 levels.
# Setting up pagination support (?page=3) kind of breaks the RESTful approach.
# The railscast about Nested Resources.
# Using RESTful ajax calls, a great lib by dfr|work (#rubyonrails).
Raphael: Amazing vector graphics Javascript Libraty
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.
Raphael Supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+ which is pretty awesome and allows you to do almost any graphic task you have in mind, just check the demos.
Raphael weighs about 110kb uncompressed, which is kind of an issue i think.
Get it here at the Raphael Homepage
Storing Files in Ruby on Rails
I finished my post before reading theirs and didn't add things Koz wrote and i didn't, so don't blame me in stealing or something. :)
I Know storing files in a database is usually a bad idea, but i still thought about the face that i was yet to see a propar guidance on how to handle files (using the correct practices of course).
Plugins
Attachement_fu - The older brother, pretty nice, better than the late file_column.
PaperClip - An "updated" attachement_fu, some people say it's better than attachement_fu because it is actually working. There is a lot more work being done on this plugin now a days, so it's better to relay on it rather than on attachment_fu.
Storing your files.
Local File System
This option can only work out for you, if you are running your app on a single server, simply set one of the plugins to store the uploaded files whereever you want, and that's it.
You can also setup a network folder if you'd like and imitate a local folder across a number of servers, but i's the same.
What you do need to be careful from, is a situation where you are saving too many files into a single folder, which will cause mainly for a slow file lookup.
Try to refine you directory structures for your upload root in order to avoid such a problem.
Amazon S3
The main reasons to use Amazon S3 are that it's amazingly scalable and incrediably cheap. Other than that it's pretty easy to manage using the plugins or some gems around there, and it's generally offloading the weight of sending files to your users an keeping your application servers busy (i wrote before on apache's x-sendfile header, that's another way).
and... still.. BLOBs
As i said before, i am not a fan of storing files in your db, seems like out of context for me, but some people like it.
If you insist (and you shouldn't) , you'll need to setup a proper migration to handle BLOBs, and the rest is up to you.
Live Free: Open Source Software indexes
- OS Living - Great index, cut into categories.
- Wikipedia - List of free open source software.
- OpenSourceList - Anthoer category based list, some of the stuff here are Close Source, but still free to use.
- 50 Apps to manage your Office with open source - This list consists over linux based programs, but i think that Ubunut is anyway the number #1 replacement for windows in offices (except mine where everyone got a mac, haha).
- 5 Business free applications - why pink?! :)
Debugging Javascript in Web Applications: Major browser roundup
![](http://icanhascheezburger.files.wordpress.com/2008/09/funny-pictures-kitten-looks-for-bugs-in-your-computer.jpg)
Javascript is an exception, it's a de-facto web development script language, but it's rendering engine and debugging options vary from browser to browser.
I gathered up a list of common web debugging tools for Javascript. i will be happy to get some more ideas from everyone.
here we go:
The ultimate solution - Firebug addon
ok, i know what you might say: "it's a FIREFOX addon!, how can it be THE ultimate solution?".
Well, good news.
Along side the plain firefox addon, there's also a lite version that runs as a seperate javascript on Safari, Opera and yes, IE.
The Lite version is not as comprehensive as the addon, but it's more than a blessing when dealing with IE javascript bugs ("line:33, char:33 crap").
General
JSLINT.COM - Javascript verifier
Just paste your JS code and let this cute little tool and watch the Javascript errors flow back at you. important to add that it does not recognize frameworks conventions (the jQuery $ selector is considered as a Global definition, use JQuery instead) and will not identify browser specific issues, it's marely a javascript syntax checker.
BlackBird.js - Cross browser javascript logger
Blackbird offers a dead-simple way to log messages in JavaScript and an attractive console to view and filter them.
Internet Explorer - Evil, annoying, can't we just drop it?
DebugBar - Firebug's little brother
debugbar is a nice Firebug mockup for IE, simple but not as strong as Firebug. problems are that it's not free, and you'll have to install a whole lot of crap on your computer. too bad.
you can also checkout the Compainion.js free version of a javascript console for IE.
IE Developer Toolbar - HTML, CSS, no Javascript
Let's face it, the IE's so-called javascript engine just sucks, any attempt they'll do to fix it must start by simply re-fuckin-write it.
The IE Developer Toolbar is a poor attempt to find a solution for some of the problems facing a web developer when dealing with IE, but at least it's something.
Safari - When i am not working, that's the one.
*by saying Safari, i mean the MacOS one, not that fucked up Windows version, yak.
Safari came from Apple, so it's probably padded with thought, intention and considiration to any kind of end-user, as well as a developer.
The Safari developer tools are nice, from a very descriptive, good looking Console and Network stats, to a rendering engine that can mimic other browsers (although i am not sure how good it is.).
This "How to Debug Javascript in Safari" article contains all you'll need to know.
FireFox - by the developers, for the developers
I have to say it, but if you made it this far and you still havn't figured out how to debug Javascript in Firefox, you have a problem.
Debugging Javascript is all about the Addons engine. This huge gallery contains a lot of web development related addons and tools, just go there and pick what you want.
Two addons you'll have to pay attention to are the Web Developer toolbar addon, and Firebug we've mentioned before.
![](http://img.zemanta.com/pixy.gif?x-id=8a1cdf09-a446-407c-9ffc-4b906996ea02)
140 Characters Web applications
I guess it right, you too i guess. "Twitter".
![](http://img.zemanta.com/pixy.gif?x-id=f958c3a4-5c02-47d2-bfdf-43acbc4b5cf4)
Rails and Facebook: Why (still) iFrame is better than FBML
What most people don't realize, is that there is not need to choose.
You can (not easily though) to get your iFrame application to handle and use FBML tags in a cool hybridy-ee way, and by that scoring the most points you can with both approaches.
Using iFrame has it's issues of course, you are going to lose primeraly the basics of the Facebook UI tools (tabs, borders and such) and you'll find yourself sometimes having rendered the entire Facebook layout in your iFrame, thau causing it to appear twice (some say twice too many).
What's good about choosing the iFrame approach is that:
- Complete control over your content. You’re essentially communicating back and forth with your own server; no middleman. FBML requires that you return your content, which can contain html and fbml, back to Facebook. They parse it and render your content.
- Javascript/Ajax considerations. FBML application type parses all your css and javascript and prepend all styles and methods with a unique app number such that all methods go from ‘do_this()’ to something like, ‘app_23423423_do_this()’. This creates a lot of extra work for you, especially if you are using Ajax in your app. Further more, some events are not allowed at all, while listeners are allowed.
- iframe allows you to develop locally.
- Rails and RESTful routing. If your application takes advantage or RESTful routing and you choose FBML you will be required to adjust for the fact that all requests to your callback url from Facebook are POST requests, which obviously is a pretty big problem.
There are some things you don’t get, but they are mainly UI things like the styles and tabs that make your content look more like Facebook content. Even if you choose iframe, you can pass the param
fb_force_mode=fbml
to take advantage of the things that really are useful such as the request forms and other FBML tags (therefore the hybrid theory :) )
![](http://img.zemanta.com/pixy.gif?x-id=cd99ae68-ad06-4ddc-9b1c-684f04450ede)
Rails Facebook App Enlightments: HTTP timeouts
Since i had to handle so much crap with Facebook, Rails and the Facebooker plugin in order to get my latest application up, i decided to share a little bit with other innocent coders straying in the path of hell.
The Facebooker plugin interfaces with the Facebook API using the Net::HTTP ruby library and POSTs API requests (API call, FQL..) using the #post method (eventually, there's a whole bunch of stuff happening before that).
It sounds nice, it really does, problem is that in this specific app we have send a whole bunch of such requests to facebook, some requests return 1000-17,000+ strings back as JSON.... what makes Facebook simply.. stale.
Now getting like 3,400 Timeout exceptions raised in your production servers (adding that the CPU is on 3.2%, RAM is at 10%) is annoying. really annoying.
The "patch" we found for this issue was to ensure a specific amount of retries to be made by rescuing the Timeout Exception.
def get_my_somefing_from_fb retry_count = 0 begin do facebook crap rescue TimeoutError if (retry_count < 5) retry_count+=1 retry end end end
Now we are watching it closely to see exactly how it helps us, if at all.
Rant: Why i Hate Facebook (API)
Through the past few weeks, I've been working on a facebook application, one of this year's todo list items, with my friend Lior Levin.
Well, it's been hell.
Not because of Lior :), but becasue of Facebook's horrible horrible API, i haven't seen such a bad API implementation since working on a Tranzila Credit card gateway in Israel, two years ago.
The facebook api and the entire application-programming-guidelines are idiotic, they offer the support of iFrame applications.
"good, actually great" you think.. "at least i woun't have to use the crappy FBML mishmash thingie... and i can use JQuery!" - But you are wrong, although all of these things are true, using the iFrame interface you are not touching any FBML crap and can use any JS Framework you'd like, but the horrors... the horrors.
First of all, each applications must have a set of callbacks assigned in the application's setting page: callback for application main gate, post authorization, post remove and another thing that doesn't matter now.
No RESTful web service support what so ever, except for the main application page, all other callbacks are POSTs, what's the problem?
When being a loyal Rails developer, you'd use RESTful routes almost by default, it's just right, but what do you do when Facebook decides that user removal actions should be POSTed and not DELETEd? you fuck up your routes.rb to match that, great.
The iFrame is a whole different story, if a user is yet to add your application, he will be redirected to an "Allow application to do this and that" page, what's the problem? that the redirection happend WITHIN THE IFRAME! which basically now causes the user to see a double facebook top bar from that moment until he refreshes the entire screen.
Crap.
It took me a while but i found a way passed it by flagging the first time a user comes in, and JS redirect the top document to an hard coded application url.
In this whole mess there was a single light in the end of the tunnel, which is the Facebooker plugin, which work great but it's documentation and online tutorial basically suck.
Maybe i'll do a new one...
done.
Startup Thoughts: Realty and a Dream
Everyone wants to be a big bad rock star entrepreneur, wake up to that morning when your bank account is flooded by plain cold cash, you are making millions while sitting at home and watching the download meter of your software or user count of your web site flying sky high every day.
Well, it's possible, many people have done that, and the nice thing about the web/internet world, is that there will be always, always, enough to share.
But it's a long way, and as the nature of things that take long, they tend to break our spirit, get us bored and insecure and afraid of competition.
I have gathered around a few misconceptions about startups and entrepreneurship, misconceptions that most people around this business seems to posses, but those who won't, these are the ones who break forward.
Misconception #1 - "Fast, Fast, Fast"
Well, shortly.. NO!
Nothing is more important than keeping your startup organized, Clear and planned ahead. Programming fast does not guarantee a better product, Designing, looking around a bit and gathering the baseline on which your consist your product, does guarantee a better product.
Get yourself a clear milestone plan, point out Alpha version (Standalone POC), private beta (for users you self pick) and a public beta, and stick with this plan!.
Misconception #2 - "We'll grow with it"
Scaling... people seem to forget about it, more like avoid it until the "twitter/dzone/digg affect" hit's their home page.
Web application tend to collect more users in a period of time than a downloaded software, web applications are also a single point of service (in case of SaaS), so you'd better get your system infrastructure ready and available for a user boost one day or another, viral marketing can be a dangerous thing.
Misconception #3 - "I've had enough"
i've heard people say "if this project doesn't go public in 5 months, i am out" or "i can't work with this people, i'm out". There's a word for people like that.
quitters.
and quitters don't get rich.
The people you work with may be annoying as hell, stupid as hell or useless as hell, if you truly believe in the concept of the idea, don't let anyone else's negligence to take what is yours and do everything you can (and you ALWAYS can) to get the startup up and running.
Misconception #4 - "We need more money"
Sometimes you do, sometimes you don't.
In order to get a website up and running these days, ready and eager to handle thousands of users, you only need AWS, which if you exaggerate like hell with your configuration, you'll get to 1000$ a month.
So following my previous post, you should know that one or more of your partners must be able to supply you with technical solutions (system administration, coding) so this should almost never be counted as an expense.
Most of the most successful startups were not founded, ever. keep that in mind.
Startup Thoughts: Sharing the cake
I've been involved in several startup projects lately. I the majority of them, one of the main reasons why founders and equity owners start to fight one another, is the moment in which someone thinks some equity needs to be shared with someone else, out side the current equity holders circle.
Well, nobody likes to give out equity and it's hard to know when and tho whom such company/project holdings should be granted.
The option of giving out equity, is mostly driven by the fact the founders need money to make their idea come to life, money or an equivalent needed resource (advisers, tech people). When there is no money, you need to ask yourself one question.
Do i REAALLLY need it?
.
They say that holding 100% of 0, is 0.. and they are right, if you will hold your equity holdings close to the chest and refuse to share no matter what, you'll probably heading straight down the hill. But on the other hand, giving out equity for anyone who wants some, or giving unreasonable amounts for that matter, is same as bad.
You can't do anything by yourself, you have to share your idea with some other people (unless you are really something special).
The first time you share your project equity with the other founders is simple and easy, most of the time the equity will be divided equally (and it doesn't matter who brought the idea, it's irrelevant) among the founders, stated in a partnership agreement later to be replaced by and incorporated entity legal documents.
Now when it gets to expanding the circle, there are two kinds of entrepreneurs that i can across with:
- Hard - These guys are either possessed with a too-high-self-confidence and sure that they can make it to the finish line without sharing a 0.1% with anyone else except for the initial founder circle or people with a wise project-wide view of things and insists of not giving away equity until it's absolutely necessary. He believe that any problem can be solved either by finding other forms of getting the required service/resource and will do whatever necessary in order to make things work out without having to release equity or unnecessary funds.
It's hard to distinct between these two sides of the Hard Core entrepreneur, but if you have the second kind of person in your team, you are a winner. - Soft - The soft entrepreneur is the the person who will be willing to give away anything for a little help. They will prefer to give away equity as much as possible like hot buns when it's not necessary and not required.
- "Don't care" - people who prefer not to take a stand, and will leave everything in the hands of other founder or all the others together. While this can be very useful when he goes your way, it's a problem when he's not.
I don't believe in workplace democracy, not all the time. Sharing equity should be unanimously passed if it is taken in a vote matter, or by a single responsible position holder (CEO for ex.).
Each one of the initial founders holds his share for a reason, he earned by contibuting to the success of the project and therefore should not be downsized unless he agrees.
You are not giving out equity to whoever comes your path, this list of people you should consider giving equaty to in exchage to their services.
- External CEO - You know how to program and design, but you don't know nothing about the business world and need someone else to guide your project to success. An external CEO is a good solution for that as long as he really understands what your idea is all about, what rarely happen.
Nobody knows your product better than you or your fellow founders for my opinion, but if you need a CEO, grant out about 10-12%. - Venture Capital Firm - The start-up Messiah, will generally have their own demands but it will move around 20%-60%.
- Strategic Investment - Someone who has the capabilities to bring your product to your desired market, audience and exposure. Depends on what he can give you, the appropriate share for such a service is 13-17%.
- Angel - A small financial investment that it's entire purpose is to get things running. 10%-15% is enough, but note that if it's a first financial investment, it's also sets your company value. (10% for 25K, brings your company to a 250,000 value, and your share grows as well.
- Tech Services - If you are going for a tech related project, such as a website or a software, make sure the other founders can supply as much as possible from the project's technical requirements, if you didn't (bad) and still need these services, grant about 0.2% for a programmer and 3%-4% for a team leader.
Keep in mind that anything that can wait, should wait and the Internet is a pretty big place for you to find what this people will probably charge 100$ an hour to tell you.
When you do need a lawyer or counseling, pay the money and that's it, no equity for counseling.
Last thing, keep in mind that there are wolves out there, people who seek to only find young, naive entrepreneur to which they can sell any dreams they want.
Consider every offer, but make the most to avoid sharing if you can, and if you do, share as little as possible.
The Lazy Web Developer: web 2.0 generators list
1. Web 2.0 Generator
It's really stupid, but you can't exclude a "Web 2.0 generator" named tool from a list with the same name.
Stripe Generator 2.0
Stir
Are you a fan of Tabs? Here is a handy web generator for you. With these tab generator, you can see what the page you will look like and when you are done creating just click download and it will give you the PNG file. That easy.
Button Generator
Well you got the Layout, badges, tabs What else can do need? Some buttons to offer the free downloads or maybe something else. Buttanator will help you with that easily generate web 2.0 . There are more button generators. I will add the link at the end of the post.
“A favicon (short for favorites icon), also known as a website icon, shortcut icon, url icon, or bookmark icon is a 16×16 pixel square icon associated with a particular website or webpage. (source)”
If you want to create professional a web site a favicon is a must. I have seen many websites that is a professional , nicely designed site but lacks a favicon. With these generator you can see the favicon in your browser in real time. If you have an image you can generate favcion from the image too.
Stop wasting your time on creating pre loaders. Instead use this generator. I absolutely love this site. They have all kinds of loader and you change the color and background. Also, this site has nice design as well.
Some of the web sites sometime gives out free vectors, photshop brushes and more. They put the images of the brushed on a realistic 3d box. Take a look at Bittbox example. It can be done in Photoshop or a good image editor. But why not use something easy. Just upload 3 images for the box (front,sides and top) in less than a minute you will have a 3d box with any kind format you want to download. Take a look at the box i created just using a random image. Isn’ t that great or what?!!!!!
If you are a photograppher or someone who has lots images on your site and make sure people do not steal your images, use this tools to watermark images. The cool thing about Picmarker you can watermark your images from your computer, facebook, flickr, Picasa album. The watermark again can be done using any image editors. But this tools allows you to watermark couple images easily.
Easily Create Rounded CSS corners with HTML and CSS.
Also check out…
- BGPatterns : Another useful patterns creator with symbols. Really useful site.
- Fresh Generator : Generate Web 2.0 buttons, rounded corners, boxes and more.
- Website Ribbon Generator: Another awesome generator. Nice, easy and beautiful.
- Free Post it Note Generator: Can this get any better? Generate Cool hand written Post it note.
- XHTML/CSS Markup Generator : If your are like me who forgets all the tags, use this tools to generate the markup.
- Reflection Maker: If you have an image you want to create a reflection, upload and choose the size and Your done! So easy and convenient.
- Genfavicon: Another Favicon generator.
- Web 2.0 logo creator: Create web 2.0 logos easily.
- Stripe Designer: Generate stripes with many different options.
- Tartan Generator: Forget stripes use tartan. This utility will help you to generate a nice tartan.
- Free Footer Generator: FreeFooter is an easy and fast tool that simplifies how you personalize your web site blog page footer.
- Fresh Badge : Anoter Brush Generator.
- Cool Text : Free Graphics and Button Generator.
- Color Scheme Generator: The Color Wizard is a color matching application for anyone who wants to create designs with great looking colors.
- WebFX: A web Based graphic effect generator. Choose an image from your site and let WebFX do the rest.
- Dotetemplate: Build and customize a whole website with this web generator.
- Avater Generator : Generate Web 2.0 avatar with text or more.
- Wordpress Plugin Generator: No idea! Check it out if t works and let me know.
- CSS sticky footer: Not a generator , a CSS technique to make your footer stick at the bottom of the page.
![](http://img.zemanta.com/pixy.gif?x-id=703055c1-01f6-49ef-9eed-17e3932a9c82)
How to avoid screwing up a software project
Run Programmer, Run
When developing a new application, mostly when it's being done personally and alone, can sometimes be a very complicated process. you'll need to handle a whole bunch of other stuff than just coding (marketing, server setups even investors hunt) and it can sometimes lead you to a software neglection.Don't let it happen, run/compile your application every few days, keep it living in your head.
Sometimes you'll start work on some big shiny feature (e.g. adding a kewl Google maps integration), but stop because you hit a technical bump ("What? no maps for Israel?"), or don’t have the time to finish it ("Need to finish this Company profile by tomorrow") and The source code is left in unfinished state.
You can’t do anything with any of your code until this is fixed, and the longer you leave it, the more you’ll forget and the harder it will be to get started again.
This is called a "broken build", and is a big landmine because it impacts other peoples ability to work (And your ability to continue as well).
TIP #1: You started something? finish it before moving on to something else.
TIP #2: Stay in touch with your software.
"I Sure could use a time machine right now...."
Know these times when you wished you had a time machine? well, it can happen in the process of developing and application too.People make mistakes, Always. When people make mistakes in the kitchen, the food comes out really bad and you call the local pizza delivery services and solve the problem. When a programmer makes a mistake or is doing a system wide change... you'll need a ready to use Plan B around.
Source Control is the software world equivalent of a time machine, you can go back to a certain version of your application and rollback any changes made to your code and application, and by that, maybe reversing a very serious threat to your code.
If you haven’t taken the plunge with revision control yet, I highly recommend looking at some of the free SVN or GIT hosting services post.
TIP #3: Save yourself, use a source control service.
"Look at this cooooooolll JQuery accordation!"
Features are fun, Javascript magic is amazing, but you'll need to focus on what's really importantFocusing on things like validation, cool eye candies or extra functions is a great way to build up a large complex code base that doesn’t do anything useful yet.
Focus on the core functionality of your software first — your main features should be complete before you start thinking about WOW stuff.
Wasting trying to think of the perfect name, designing a logo or an icon, choosing the perfect open-source license and making a website won’t get you any closer to having a working application.
TIP #4: Core functionality first, fun - later.
Throw your code away and start from scratch - The Netscape mistake
As Netscape famously discovered a few years ago, throwing away existing code to start afresh is almost never a good idea. Resist the urge and make a series of small, manageable code re-factoring instead.TIP #5: Never sink your own boat, pickup a bucket and start pulling out water
Pull yourself together before you sit down
"mmm, Rails? or maybe Adobe Air? or maybe... maybe we'll do the cool gears thing?" Before doing anything ask yourself a simple question - "What are you actually trying to achieve?", Spend some time with a pen and some paper coming up with a really clear vision of what you’re trying to create — e.g. screen mock-ups, basic core functionality (yes, again) and if there is a process you are trying to imitate, go through it too.
TIP #6: If you don’t know what you’re doing from the beginning, you’ll have no chance of finishing it.
Get the right men for the job
You maybe a coding genius, a super-programmer (Mike it's you) or other superior programming entity. but unless you are a really something no one had ever seen before, you don't know anything there is to know about every aspect of developing a new software and a products.If you can't tell the difference between red and green, get a designer to work for you. if you don't have a clue in CSS or DB infrastructure, get someone who know this art to do it.
TIP #7: Do what you know, not what you don't know.
Marketing is Important, but when it's time
Tell people about your product when you have something to show, open a product twitter account when you have something to say, don't rush yourself forward and try to stick the product or create a hype when you can't back it up by at least screenshots or an actual product on the best scenario.TIP #8: Invite people in when you have something to offer them to eat.
The difference between a lie and a promise
Users don't mind waiting for features, they mind finding out you promised them something and didn't deliver.Stand up to your words, and update your users about development progress and new features on the way, as long as you really intend to do it and not just saying to make them download or register.
TIP #9: Users are like your mother, lie to them, and they'll know.
Rails 2.3: Weird multipart form bug
Edge versions, such as the latest Rails 2.3 RC0 release often break a lot of core operations, and that's why it's called RC
Yesterday at #rubyonrails on freenode, some dude came by with weird weird bug regarding one of it's application's forms:
When he has 2 file upload columns, and a free text field between them, upon submitting the form the text area value is no where to be found on the params hash.
After trying to help him and try to approach this matter from several directions with no success, he came up with this ticket he found on the Rails code ticket report system - "Posting a multipart form with file data can break params assignment (in 2.3)".
My advice: wait a while before you use edge, unless you really intend of finiding these bugs, that's OK... just don't try that for production.
![](http://img.zemanta.com/pixy.gif?x-id=5ec07da3-c3a2-4b36-9b66-ac739204ff51)
Twiters Around
About Me
![My photo](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs1pM1QX1-5zsOsY-WGJYOKMIJmZh76Oygzb57Rv6bm5XmC8djNNYUhG5hSwJFLlhAzqf0TYVjx5tEF-qLUelzMj0O7xxNR7NqINrxBfK54xwnADI6zLvjIiK-GpILR0M/s220/me.jpg)
- Elad Meidar
- I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.
Blog Archive
-
▼
2009 (67)
-
▼
March (9)
- Moved to Mephisto
- Rails Nested Resources Tutorial
- Raphael: Amazing vector graphics Javascript Libraty
- Storing Files in Ruby on Rails
- Live Free: Open Source Software indexes
- Debugging Javascript in Web Applications: Major br...
- 140 Characters Web applications
- Rails and Facebook: Why (still) iFrame is better t...
- Rails Facebook App Enlightments: HTTP timeouts
-
▼
March (9)
Labels
- 1.9 (1)
- 2.0 (1)
- 2.2 (1)
- 2.3 (1)
- 2.x (1)
- accessibility (2)
- account (1)
- actionmailer (1)
- activerecord (3)
- adsense (1)
- affiliate (1)
- ajax (3)
- amazon (4)
- analytics (1)
- api (3)
- application (1)
- array (1)
- associations (1)
- attachment_fu (1)
- autocomplete (1)
- aws (2)
- blog (4)
- books (4)
- boolean (1)
- browser (8)
- browsers (3)
- bugs (4)
- buzz (1)
- callback (1)
- callbacks (1)
- caller (1)
- capistrano (1)
- chronic (1)
- class (2)
- classes (1)
- classifieds (1)
- client (1)
- coding (2)
- collboration (1)
- console (2)
- convert (1)
- core (2)
- core. object (1)
- cost (1)
- css (7)
- database (10)
- date (3)
- dating (1)
- db (2)
- debug (2)
- deploy (5)
- deployment (3)
- design (11)
- development (5)
- dojo (1)
- eager (1)
- ec2 (2)
- effects (1)
- elad (2)
- email (3)
- engine (1)
- engineyard (1)
- english (1)
- entrepreneur (1)
- environment (2)
- erd (1)
- error (1)
- example (1)
- expire (1)
- explorer (1)
- extention (1)
- extra (2)
- facebook (2)
- fast (1)
- file (1)
- files (1)
- firefox (4)
- fixtures (1)
- font (1)
- form (1)
- framework (16)
- free (6)
- funny (2)
- gem (7)
- gems (2)
- git (5)
- globalize (2)
- gmail (3)
- google (8)
- graphes (2)
- graphics (1)
- guides (4)
- hacks (1)
- hosting (1)
- html (1)
- http (1)
- ie (5)
- ie8 (1)
- image (2)
- indomite (1)
- install (1)
- iphone (1)
- israel (2)
- javascript (19)
- JQuery (10)
- js (3)
- legacy (1)
- leopard (1)
- lib (1)
- library (3)
- links (2)
- list (1)
- loading (1)
- log (1)
- logger (2)
- logging (1)
- love (1)
- mac (4)
- mail (2)
- manuals (1)
- mapping (1)
- mass (1)
- mephisto (3)
- mercurial (1)
- meta (1)
- metaprogramming (3)
- microsoft (1)
- migrations (2)
- minimagick (1)
- mistake (1)
- mistakes (1)
- model (1)
- money (4)
- mootools (4)
- move (1)
- movies (2)
- music (1)
- mvc (2)
- mysql (2)
- native (1)
- nested (1)
- network (1)
- new (1)
- newsletter (1)
- num_to_english (1)
- numbers (2)
- object (1)
- observer (1)
- ohad (1)
- open (1)
- operators (1)
- optimization (4)
- oracle (4)
- overload (1)
- parse (1)
- pdf (4)
- php (3)
- plugin (11)
- plugins (7)
- programming (4)
- programs (1)
- projects (5)
- prototype (1)
- queries (1)
- rails (50)
- rails 2.0 (10)
- rails 2.1 (6)
- rake (2)
- rants (1)
- record (1)
- reflections (1)
- release (3)
- rendering (1)
- reset (1)
- resize (1)
- rest (1)
- rjs (1)
- ror (1)
- routes (3)
- routes.rb (2)
- ruby (49)
- ruby on bells (2)
- ruby on rails (28)
- ruby-debug (1)
- s3 (2)
- salary (1)
- scaling (2)
- schema (2)
- screencasts (1)
- script (4)
- scripts (1)
- search engine optimization (1)
- security (3)
- seeking alpha (1)
- select (1)
- sendmail (1)
- seo (2)
- sequencer (1)
- sessions (1)
- share (2)
- shell (1)
- site (3)
- site map (1)
- sites (1)
- skype (1)
- social (2)
- source (1)
- source control (4)
- sprites (1)
- sql (1)
- stand alone (1)
- standards (1)
- startup (6)
- storage (2)
- subversion (4)
- svn (1)
- team (1)
- technology (1)
- testing (1)
- textmate (1)
- thread (1)
- time (1)
- tips (45)
- tools (5)
- tracking (1)
- tricks (36)
- tutorials (5)
- ui (4)
- uml (1)
- update (1)
- upgrading (2)
- url (1)
- usability (2)
- user interface (7)
- validations (1)
- vector (1)
- vote (1)
- web (9)
- web services (2)
- web2.0 (4)
- webistrano (1)
- wire (1)
- wwr (1)
- xhtml (1)
- yahoo (1)
- yui (1)
- רובי (8)
- רובי און ריילס (7)