header image

Archive for the 'Rails' Category

Cheapest viagra

Tuesday, May 19th, 2009

obtrusive_or_not.png Update: thanks to Jon Wood aka jellybob, cheapest viagra, a prototype demonstration has been added, cheapest viagra, which is even better than my original jQuery btw as it degrades gracefully. Cheapest viagra, Check it out in the ‘prototype-unobtrusive’ directory.

I am guessing 9 out of 10 of you reading the title is prepared for yet-another Rails drama on some obtrusive community members, cheapest viagra, and because everyone is tired of Rails dramas, cheapest viagra, I am risking that some of you won’t care to read the article - but I couldn’t resist :-). Cheapest viagra, Actually I’d like to talk about usage of (un)obtrusive Javascript - why is it a bad idea to be obtrusive, cheapest viagra, especially given that (as you will learn from the article) writing unobtrusive Javascript is not harder, cheapest viagra, and you get the warm, cheapest viagra, fuzzy feeling of writing nice and clean code!

The Drill

To demonstrate the differences, cheapest viagra, I’ll lead you through the creation of a quick AJAXy shout wall both the default/standard (and obtrusive) way, cheapest viagra, then do the same with unobtrusive Javascript to show you that contrary to the popular belief, cheapest viagra, you don’t need to memorize the “Tome of Javascript Black Magick Tricks” by heart, cheapest viagra, use obscure libraries or special coding techniques to achieve clean, cheapest viagra, unobtrusive code. Cheapest viagra, The shout wall is simply a form for posting a new message, cheapest viagra, and a list of messages below it, cheapest viagra, like so:

shout_wall.png

(You can check out the code used in this post from it’s github repository).

The Standard Way

Note: If you’d like to follow along, cheapest viagra, please use the provided pastie links - do not try to cut & paste multiple lines from the page (single lines are OK), cheapest viagra, as it will be b0rk3d.

  1. Creating a new Rails application
    1. rails obtrusive-shout-wall
  2. Get into the Rails dir
    1. cd obtrusive-shout-wall
  3. Generate the resource message
    1. script/generate resource message
  4. Add this the following to the generated migration (some_timestamp_create_messages (Get it from pastie):
    1. t.string :author
    2. t.text :message
  5. Run the migrations:
    1. rake db:migrate
  6. Because we want to view the messages in reverse order (newest one first), cheapest viagra, we add a default scope to the Message model (in message.rb):
    1. default_scope :order => ‘created_at DESC’
  7. Create the application layout - create a new file in app/views/layouts called application.html.erb, cheapest viagra, and fill it with the following content (Get it from pastie):
    1. <html>
    2.   <head>
    3.     <%= stylesheet_link_tag "application" %>
    4.         <%= javascript_include_tag :defaults %>     
    5.   </head>
    6.     <body>
    7.     <%= yield %>
    8.     </body>
    9. </html>
  8. Create a file application.css and drop it into public/stylesheets. Cheapest viagra, Add the following content (Get it from pastie):
    1. body {
    2.     background-color:#FFFFFF;
    3.     color:#333333;
    4.     font-family:"Lucida Grande", cheapest viagra,verdana, cheapest viagra,arial, cheapest viagra,helvetica, cheapest viagra,sans-serif;
    5.     margin:0 auto;
    6.     padding:0;
    7.     text-align:center;
    8.     width:960px;
    9. }
    10.  
    11. #messages {
    12.     text-align: left;
    13.     margin-left: 80px;
    14.     margin-top: 50px;
    15. }
    16.  
    17. #message-form {
    18.     text-align: left;
    19. }
    20.  
    21. #message-form dl {
    22.     margin:10px 0 0 80px;
    23. }
    24.  
    25. #message-form dd {
    26. color:#666666;
    27. font-size:11px;
    28. line-height:24px;
    29. margin:0 0 5px 80px;
    30. }
    31.  
    32. #message-form dt {
    33.     float:left;
    34.     font-size:14px;
    35.     line-height:24px;
    36.     width:80px;
    37.   text-align: left;
    38. }
    39.  
    40. #author {
    41.   margin-right: 640px;
    42. }
    43.  
    44. #message {
    45.   width: 600px;
    46.     height: 200px;
    47.   margin-right: 194px;
    48. }
    49.  
    50. .message {
    51.   margin-bottom: 20px;
    52. }
    53.  
    54. .first_row {
    55.   padding-bottom: 10px;
    56. }
    57.  
    58. .message-meta {
    59.     font-size: 12px;
    60. }
    61.  
    62. .author {
    63.   color: #FF5050;
    64.     font-weight: bold;
    65. }
    66.  
    67. .new-message-label {
    68.   text-align: left;
    69.   padding-top: 30px;
    70.   margin-left: 80px;
    71. }
    72.  
    73. #submit-button {
    74.   float : right;
    75.   margin-right: 195px;
    76.   margin-top: 10px;
    77. }
  9. Create a new action, cheapest viagra, index in MessagesController (Get it from pastie):
    1. def index
    2.   @messages = Message.all   
    3. end
  10. This goes into app/views/messages/index.html.erb (Get it from pastie):
    1. <h3 class="new-message-label">Enter new message!</h3>
    2. <% remote_form_for :message, cheapest viagra, :html => {:id => "message-form"} do |form| %>
    3.   <dl>
    4.         <dt>Author:</dt>
    5.     <dd><%= text_field_tag ‘author’ %></dd>
    6.         <dt>Message:</dt>
    7.         <dd><%= text_area_tag ‘message’ %></dd>
    8.     </dl>
    9.     <%= submit_tag "Submit!", cheapest viagra, :id => "submit-button"%>
    10. <% end %>
    11.  
    12. <div id="messages">
    13.     <%= render :partial => ‘message’, cheapest viagra, :collection => @messages %>
    14. </div>
    We are showing the form for the messages and list the already exiting messages below the list. Note that we are using the _remote_form_for_ Rails helper to create an AJAXy form. Cheapest viagra, This is already obtrusive, cheapest viagra, since if you observe the generated HTML, cheapest viagra, you will see that the form has an onsubmit parameter with some horribly looking code attached to it.:

    Obtrusive helper.png

    Sure, cheapest viagra, you can go ‘meh’ all the way, cheapest viagra, but slinging Javascript code all over the place is just as bad idea as writing inline CSS (or even worse, cheapest viagra, using HTML code for styling) or putting Rails code into views. Cheapest viagra, It will work without any problems - but it’s just not the right way of doing things, cheapest viagra, especially if your code is going to hit a certain size.
  11. You probably noticed that we are rendering a message as a partial - so create a partial file app/views/messages/_message.html.erb with the following content (Get it from pastie):
    1. <div class="message" id="message-<%=message.id%>">
    2.   <div class="message-meta">on
    3.    <%= message.created_at.to_formatted_s(:long_ordinal) %>, cheapest viagra,
    4.    <span class="author"><%= message.author %></span>
    5.    said:
    6.   </div>
    7.   <div><%= message.message %></div>
    8. </div>
  12. We need a ‘create’ action in MessagesController in order to process the form submission (Get it from pastie):
    1. def create
    2.   @message = Message.create(:author => params[:author], cheapest viagra, :message => params[:message])
    3. end
  13. And obviously we’ll need to render something to respond to the create action. Cheapest viagra, Using the standard Rails way, cheapest viagra, RJS, cheapest viagra, we might come up with something like this (in app/views/messages/create.js.rjs - Get it from pastie):
    1. page.insert_html :top, cheapest viagra, "messages", cheapest viagra, :partial => ‘message’, cheapest viagra, :object => @message
    2. page.visual_effect  :highlight, cheapest viagra, "message-#{@message.id}"
    Here we insert the “messages” partial, cheapest viagra, using the just created @message, cheapest viagra, and throw a splash of yellow fade into the mix for good measure. Cheapest viagra, Easy peasy.
  14. We are done! Fire up script/server, cheapest viagra, hit localhost:3000/messages and voila!

The Good Way

Here I am presenting only the steps that are different from the above - i.e. Cheapest viagra, if step 3 is skipped, cheapest viagra, use the one from above.

  1. Creating a new Rails application
    1. rails unobtrusive-shout-wall
  2. Get into the Rails dir
    1. cd unobtrusive-shout-wall
  3. Same as above
  4. Same as above
  5. Same as above
  6. Same as above
  7. Since we are going to use jQuery (unobtrusiveness is *not* a property of jQuery, cheapest viagra, you can be just as unobtrusive with Prorotype - but I switched to jQuery just before learning how, cheapest viagra, and now I am lazy to go back check out how in the ‘prototype unobtrusive’ directory in the github repository), cheapest viagra, you have to download jQuery with some basic effects, cheapest viagra, as well as an AJAX form handling library (still from the directory unobtrusive-shout-wall - Get it from pastie):
    1. curl http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js > public/javascripts/jquery.js
    2. curl http://www.malsup.com/jquery/form/jquery.form.js?2.28 > public/javascripts/jquery-form.js
    3. curl http://view.jquery.com/tags/ui/latest/ui/effects.core.js > public/javascripts/effects.core.js
    4. curl http://view.jquery.com/tags/ui/latest/ui/effects.highlight.js > public/javascripts/effects.highlight.js
    and replace
    1. <%= javascript_include_tag :defaults %>
    with
    1. <%= javascript_include_tag ‘jquery’ %>     
    2. <%= javascript_include_tag ‘jquery-form’ %>
    3. <%= javascript_include_tag ‘application’ %>
    4. <%= javascript_include_tag ‘effects.core’ %>
    5. <%= javascript_include_tag ‘effects.highlight’ %>
    in the layout file.
  8. Same as above
  9. Same as above
  10. Same as above - just delete “remote” from the name of the helper, cheapest viagra, i.e. Cheapest viagra, use a standard Rails view helper, cheapest viagra, form_for
  11. Same as above
  12. Since we are not relying on Rails to do the rendering for as via a template file, cheapest viagra, we return the html chunk that we will render from Javascipt. Cheapest viagra, So your create action should look like (Get it from pastie):
    1. def create
    2.   @message = Message.create(:author => params[:author], cheapest viagra, :message => params[:message])
    3.   render :partial => ‘message’, cheapest viagra, :object => @message
    4. end
  13. Now comes the fundamentally different part - instead of using RJS to respond to the create action, cheapest viagra, we move all our code to application.js (Get if from pastie):
    1. $(document).ready(function() {     
    2.   $("#message-form").ajaxForm({success: handleNewMessage});
    3.  
    4.   function handleNewMessage(response, cheapest viagra, statusText) {
    5.     $("#messages").prepend(response).effect("highlight", cheapest viagra, {}, cheapest viagra, 1500);
    6.   }   
    7. });
    I don’t think so that this code is particularly more complicated or hard to understand that the RJS one. Cheapest viagra, Everything is inside the ready() function, cheapest viagra, which means that it’s only run once the document is properly loaded. Cheapest viagra, Then we declare that “#message-form” is an AJAX form, cheapest viagra, and that upon successful submission, cheapest viagra, the handleNewMessage() method should be called. Cheapest viagra, And if that happens, cheapest viagra, we add the response (which is the return value of the “create” action) to the “#messages” div, cheapest viagra, just as we did in RJS. Cheapest viagra, Then we apply the yellow fade! w00t!
  14. Same as above

(You can check out the code used in this post from it’s github repository).

Conclusion

As you can see, cheapest viagra, the only real difference between the obtrusive and non-obtrusive version is in the last 2 points (downloading and including the jQuery header files can be easily solved with Rails templates): instead of leaving the rendering part to Rails, cheapest viagra, we return the response as a string and dynamically insert it from jQuery. Cheapest viagra, With about the same effort, cheapest viagra, we kept all the Javascript code in application.js, cheapest viagra, which is much cleaner this way (you can open up 1 file and check out all the JS/AJAX behavior in one place), cheapest viagra, especially after introducing a lot of Javascript functionality into your code - in other words, cheapest viagra, for the same amount of work we got something much better. Cheapest viagra, Please try to keep this in mind when you are working with Javascript and Rails the next time - believe me, cheapest viagra, it can save you from a lot of pain!

Similar Posts:purchase viagra,cheapest viagra,buy xenical online,kamagra for sale,buy clonazepam without prescription

Cheap prozac

Monday, April 27th, 2009

nice_ass.png

While I know the title is both asking for trouble (because of the now anecdotal original article with a similar title) and flamebaity, cheap prozac, please read on - my goal is not to get some great stats but rather to know your opinion about the situation and discuss the possible solutions of the problem.

How it all started…

I would not like to re-iterate what has been said on several blogs, cheap prozac, just to summarize: Matt Aimonetti, cheap prozac, member of the Rails Activists, cheap prozac, gave a presentation at GoGaRuCo which contained sexually explicit images (according to some - I am not here to judge whether that’s true, cheap prozac, and it doesn’t matter anyway, cheap prozac, as you’ll see in the rest of the post).

I am not really discussing whether it’s appropriate to have images of nude chicks in your presentation at a Ruby conference (I think it’s not, cheap prozac, it’s unprofessional etc. Cheap prozac, - but that would be a matter of a different post Update: Someone summed this up in the article’s reddit thread nicely: If you’re a Rails programmer, cheap prozac, or a Ruby programmer, cheap prozac, and you don’t decry this sort of thing, cheap prozac, you have no business calling yourself a professional. Cheap prozac, It doesn’t matter how large your website is, cheap prozac, how easy it was to write, cheap prozac, how much better it is over PHP or ASP.NET or J2EE; by definition, cheap prozac, you do not belong to a professional community. Cheap prozac, That’s all there is to it. It’s incumbent on every Ruby programmer to either reject this sort of misogynistic sewage, cheap prozac, or accept that you’re never going to advance the promotion of Rails in the public perception because members of the community still think it’s edgy or cool to put pictures of strippers in their public presentations. And here’s a hint: if your decided reaction is to talk about how unimportant this is, cheap prozac, how much it doesn’t matter, cheap prozac, or how much it doesn’t offend you personally, cheap prozac, you probably don’t understand professionalism at all.) because sadly, cheap prozac, I think there are far bigger problems here than that - shedding light on them is the real purpose of the article, cheap prozac, not talking about pr0n at GoGaRuCo again.

Would You Walk Into a Hindu Temple with Your Shoes on?

hindu_temple.pngI have been living in India for 2 months last summer, cheap prozac, working on a Rails startup. Cheap prozac, Maybe I am odd or something, cheap prozac, but I knew that I had to remove my shoes when entering a Hindu temple, cheap prozac, and no one had to convince me (what’s more, cheap prozac, I didn’t even think about it for a second) wether this is the right thing to do, cheap prozac, why is it so, cheap prozac, whether I should do otherwise etc. Cheap prozac, This is a similar situation - I just don’t do X when speaking at a conference, cheap prozac, if I suspect that X makes feel even one person in the room uncomfortable, cheap prozac, whether because of his gender, cheap prozac, race, cheap prozac, nationality, cheap prozac, Ruby/Rails skills, cheap prozac, penis size or what have you - regardless whether I think it’s fine for me, cheap prozac, my wife, cheap prozac, for other members of the community and/or the majority of the room. Cheap prozac,

The trick is, cheap prozac, how does a hindu feel when I enter a temple in footwear (even if that is perfectly acceptable in my country, cheap prozac, culture, cheap prozac, family, cheap prozac, friends) - it’s perfectly irrelevant how do I feel in the given situation. Cheap prozac, Using the previous paragraph, cheap prozac, try to apply this to a Ruby/Rails conference.

Shit happens…

Until this point in the story, cheap prozac, I see no problem at all, cheap prozac, and could even agree with the guys asking “what’s wrong with you, cheap prozac, don’t make a fuss out of nothing” - the pictures Matt used are non-problematic in my book, cheap prozac, and he had no idea they are problematic in anyone’s book - theoretically it could have worked, cheap prozac, but the point is, cheap prozac, it did not. Cheap prozac, Some members of the Ruby community got offended, cheap prozac, and here our story begins.

…and hits the fan

One of the real problems is that after this has been pointed out, cheap prozac, Matt still keeps answering “As mentioned many times earlier, cheap prozac, I don’t think my presentation is inappropriate.”. Cheap prozac, As I mentioned two paragraph above, cheap prozac, it doesn’t matter what do you think, cheap prozac, unless of course, cheap prozac, you don’t care about offending some members of the community. Cheap prozac, In that case you should not try to apologize at all. Cheap prozac, However, cheap prozac, if you are trying, cheap prozac, reciting “I don’t think my presentation is inappropriate” will not put and end to the discussion. Cheap prozac, It just doesn’t work. Cheap prozac, Why can’t you just simply apologize, cheap prozac, admitting that this was a bad move (because it offended some, cheap prozac, not because porn, cheap prozac, sexual images or whatever in presentations are bad, cheap prozac, per se) and finish the discussion?

Rails is Still a Ghetto

However, cheap prozac, in my opinion that’s still not the worst part of the story, cheap prozac, or to put it differently, cheap prozac, some members of the Rails community still found a way to make things worse, cheap prozac, by applauding to all this:

dhh_pr0n_is_great.png

OK, cheap prozac, you say, cheap prozac, we are all used to DHH’s style, cheap prozac, this is just how the guy is. Cheap prozac, That’s (kind of) cool, cheap prozac, but I heard that most of the Rails core team (and obviously Matt himself) has the same opinion - and that’s a much more serious problem, cheap prozac, because it means that a Rails activist, cheap prozac, backed by DHH and other Rails core members finds all this OK, cheap prozac, despite of the fact that numerous people in the community voiced their opinion otherwise.

This is not about being a closed-minded prude, cheap prozac, shouting for police and suing everyone using sexually explicit images in a presentation. Cheap prozac, This is not even about women, cheap prozac, as I have seen both males and females on either side of the fence. Cheap prozac, This is about mutual respect - I don’t agree with you, cheap prozac, but respect your feelings. Cheap prozac, Or not, cheap prozac, as demonstrated in this case.

So Rails continues to be the most socially unacceptable framework - associated with arrogance, cheap prozac, elitism and whatnot in the past - now add pr0n images in presentations. Cheap prozac, Thankfully RailsConf is held in Las Vegas, cheap prozac, and that should calm down all the people who associate Rails with all this crap :-). Cheap prozac, The real problem is that people associate you with the tools you are using - think Cobol, cheap prozac, PHP, cheap prozac, Java… Cheap prozac, or Rails. Cheap prozac, By being part of the Rails community people associate me with Railsy stereotypes automatically, cheap prozac, which aren’t nice at all right now.

I hear you, cheap prozac, dear creme-de-la-creme Rails (core) member, cheap prozac, I know you don’t give a shit, cheap prozac, and you think this is all prude babbling - because your hourly rate is more than some of us earn in a day, cheap prozac, and you’ll be sought after even if Rails will have a much worse image than it has now. Cheap prozac, But 99.9% of us are not in the ‘circle of trust’ and would be happier if Rails would not be constantly associated with a ghetto.

MINASWUBN

In case you are wondering what does the acronym stand for, cheap prozac, it’s “Matz is Nice And So We Used to Be Nice”. Cheap prozac, Unfortunately, cheap prozac, the stuff I don’t like about the Rails community is sneaking into Ruby too, cheap prozac, it seems, cheap prozac, as the above case demonstrates. Cheap prozac, Besides this, cheap prozac, the count of aggressive comments and reactions on various blog posts is really disturbing to me. Cheap prozac, Please (at least Rubyists) try to avoid being contaminated by all this shit and stop thinking you are cool because you can swear on a forum (always in anonymity). Cheap prozac, You don’t have to be a douchebag just because you are a Rubyist / Rails coder, cheap prozac, as surprising as this might sound to some.

Conclusion

I think “incidents” like this and getting more and more antisocial members are inevitable by-products of growth in a community. Cheap prozac, The questions is, cheap prozac, whether, cheap prozac, and if, cheap prozac, how, cheap prozac, do we stop them. Cheap prozac, The problem is that it seems to me the Rails “top management” doesn’t want to stop them (what’s more, cheap prozac, even encourages them) in the first place (please prove me otherwise - maybe I don’t see the full story - I’ll be the happiest to admit that I am talking bullshit).

I have to admit I have no clue what would be the right move - burying our heads in the sand and pretending everything is fine is not. Cheap prozac, Please leave a comment if you have an idea or anything to add.

Similar Posts:tramadol sale,cheap prozac,cheap tramadol,amoxil sale,doxycycline for order

Cheapest cialis

Thursday, November 13th, 2008

rails_rumble.png In part I I wrote about the hows and whys of gathering gem/plugin usage data based on Rails Rumble submitted user information, cheapest cialis, and in this part I would like to present my findings. Cheapest cialis, So without further ado, cheapest cialis, here we go:

Prototype/jQuery

I already covered this in part I, cheapest cialis, but for completeness’ sake, cheapest cialis, here is the chart again:

prototype_jquery.png
It seems that jQuery is (not so) slowly replacing Prototype as the javascript framework of Rails - which is still better (from the Prototype POV) than with Merb, cheapest cialis, where jQuery is the default framework (oh yeah, cheapest cialis, I know, cheapest cialis, Merb is everything-agnostic etc. Cheapest cialis, etc. Cheapest cialis, but I think vast majority of merbists are using Datamapper, cheapest cialis, jQuery etc. Cheapest cialis, (?)).

Skeleton Applications

Well… Cheapest cialis, this chart is rather dull:

bort.png

One in every three teams used a skeleton application (which in this context can be replaced with ‘Bort’). Cheapest cialis, The sovereignity of Bort is a bit surprising given that it’s not the only player in the field by far - there are definitely others, cheapest cialis, like ThoughtBot’s suspenders, cheapest cialis, Blank by James Golick, cheapest cialis, starter-app by Pat Maddox, cheapest cialis, appstarter by Lattice Purple just to name a few.

I am not sure about the others, cheapest cialis, but the absence of suspenders from the chart has more to do with the fact that it was not yet publicly released before Rails Rumble - I am basing this claim on the fact that a lot of people used the gems/plugins which, cheapest cialis, combined together, cheapest cialis, are basically suspenders.

However, cheapest cialis, this doesn’t alter the fact that Bort is immensely popular - great stuff, cheapest cialis, Jim.

Testing Frameworks

I think there are (at least) 2 things to note here:

  1. Testing in Ruby/Rails is not considered optional even facing a very tight deadline. Cheapest cialis, Even if we assume that the 49% didn’t test at all (which surely doesn’t sound too realistic - they probably just went with Test::Unit), cheapest cialis, more than half of the teams did!
  2. Though testing tools are a much debated topic nowadays, cheapest cialis, and the winner is not clear (yet) - I would guess, cheapest cialis, based on the above results there is roughly an 1:1:1 ration between Test::Unit, cheapest cialis, rspec and shoulda *currently* - there are definitely interesting alternatives to Test::Unit.

testins.png

Mocking

mocking.png
Not much to add here - though the above chart says nothing about how much people are using e.g. Cheapest cialis, Mocha with rSpec (vs. Cheapest cialis, using the rSpec built-in mocking tools), cheapest cialis, one thing is clear - as a stand-alone mocking framework, cheapest cialis, Mocha reigns supreme.

Exception Notification

ex_notification.png
Another point for ThoughtBot (not the last one in this list) - Hoptoad has no disadvantage compared to the more traditional Exception Notifier (if we don’t count getting an API-key, cheapest cialis, which takes about a minute) - on the upside, cheapest cialis, you get a beautiful and user friendly web GUI.

Full-text Search

full_text.png
I found the above chart interesting for two reasons:

  1. I thought that Ferret and/or acts_as_solr are still somewhat popular - it turns out they are not
  2. I also thought Thinking Sphinx is the de-facto fulltext search plugin, cheapest cialis, and didn’t know about Xapian - well, cheapest cialis, I learned something new again.

Uploading

uploading.png
ThoughtBot did it again - Paperclip is already more popular than the old-school attachment-fu. Cheapest cialis, I am always a bit cautious when someone challenges the status quo (like Nokogiri vs. Cheapest cialis, Hpricot, cheapest cialis, Authlogic vs. Cheapest cialis, Restful Authentication, cheapest cialis, attachment-fu vs. Cheapest cialis, Paperclip etc.) but it seems Paperclip is ripe to take over. Cheapest cialis, You can find some interesting tutorials here and here.

User Authentication

Another dull graph for you:

user_auth.png
I am wondering how homogenous this chart would be if Authlogic would have appeared earlier - it seems like a strong challenger (already watched by around 260 people on github) and I am sure it will take a nice slice of the pie in the future.

What’s more interesting is the openID support: more than one third of the apps offered openID authentication, cheapest cialis, and quite a few of them solely openID.

Misc

  • factory_girl was used to replace traditional fixtures in every 6th of the apps!
  • HAML/SASS is quite popular - used in about 20% of the applications
  • Hpricot was the only HTML/XML parser used (in 7 apps alltogerher)

What I am happy about the most is that there is still a lot of innovation going on in the Rails world - as you can see, cheapest cialis, newer and newer plugins/gems are appearing and in some (in fact, cheapest cialis, a lot of) cases are dethroning their good ol’ competitors. Cheapest cialis, There is a lot of competition going on in almost every major area of Rails web development, cheapest cialis, and this is always a good thing.

Similar Posts:zoloft prescription,cheapest cialis,buy kamagra without prescription,cheapest lasix,discount zoloft

Cialis

Wednesday, November 12th, 2008

rails_rumble.png As a Rails Rumble judge, cialis, I spent quite some time reviewing the applications and I noticed several patterns regarding the gems/plugins used during the 48-hour contest. Cialis, The participants were asked to submit whatever tools they were using to build their app. Cialis, With a few exceptions they complied, cialis, creating an interesting data set to observe the current trends in the Rails world.

Collecting the Data

Unfortunately it was not possible to gather the information automatically using screen scraping or other mechanical methods, cialis, since the input was varying from free text (stating details like ‘we used Rails, cialis, macs, cialis, TextMate, cialis, cocaine (the drink!)’) etc. Cialis, to the output of gem list - and everything in-between, cialis, not following any guideline (perhaps because none was given). Cialis, So I hacked up a small app with a single form and harvested the info manually. Cialis, I only collected data for the first 100 entries, cialis, for two reasons: the stuff used in the rest of the apps was pretty much the same, cialis, and mainly: the task was rather daunting :-)

Why Does this Matter?

I believe that because of the rules (I mostly mean the 48-hour deadline) the findings are quite representative - I am sure that every team reached after the most productive/easy to use/effective tool they could grab since the deadline was tight. Cialis, Rails Rumble is not about experimentation or showing off some new shiny toys, cialis, but lightning fast hacking aided by state-of-the-art gems and plugins so I think it’s safe to assume that the tools used here are pretty much the crème de la crème of the Ruby/Rails world.

Prototype vs. Cialis, jQuery

In the first exhibit, cialis, I’d like to check out Prototype vs. Cialis, jQuery usage. Cialis, To prepare this chart, cialis, I took the extra mile and didn’t rely on the user-supplied data, cialis, but opened the pages by hand and checked the headers for Prototype/jQuery javascript includes. Cialis, Here is what I have found:

prototype_jquery.png

1 team was using mootools, cialis, the rest of the cake is divided between Prototype and jQuery. Most probably the real result is even more in favor of jQuery, cialis, I would guess well above 60% - all the teams that added jQuery to their application.html.erb were actually using it (why would they bother adding it otherwise), cialis, while this is not necessarily true for Prototype, cialis, which is included by default and maybe some teams didn’t even use it, cialis, just didn’t care to delete it (as you will learn in the next part, cialis, every 3rd team used bort, cialis, which includes the Prototype/script.aculo.us files by default).

This is not the first indicator of jQuery’s rising popularity in the Rails world - Hampton Catlin’s Ruby Survey found out the same (i.e. Cialis, jQuery is more popular right now than Prototype). Cialis, Merb is using jQuery by default.

Is Prototype Dead?

My favorite Austrian Ruby-hacker friend told me over lunch a few weeks ago: ‘Prototype is dead!’. Cialis, I think this statement is questionable at the moment to say the least, cialis, since Prototype is still the default javascript framework of Rails and this is not likely to change anytime soon due to the fact that Prototype is heavily used by 37singnals (and probably entrenched into other older Rails-apps as well). However, cialis, the trend seems to be that jQuery is spreading really fast, cialis, replacing Prototype in a lot of cases.

So be sure to check jQuery out (it’s dead easy to install and use it) - I immediately fell in love with it (maybe I was used to Hpricot-style CSS selectors too much?) and I am happily using it in my projects now.

The Next Episode

Which testing tools are used by the community? How about rails skeleton apps? OpenID support? exception-notifier or hoptoad? attachment_fu or paperclip? mocha or flexmock? factory-girl or traditional fixtures? Find out in the next installment!

Similar Posts:lexapro pills,cialis,buy cheap zithromax,viagra cheap,zopiclone online stores

Cialis pharmacy

Monday, April 21st, 2008

Similar Posts:xanax online,cialis pharmacy,lexapro for order,buy prozac,generic plavix

Generic lexapro

Tuesday, April 15th, 2008

live_validation.pngUpdate: Sergio, generic lexapro, the author of the livevalidation rails plugin updated the plugin so you can disregard the finale of the article (validatesconfirmationof is working, generic lexapro, as well as the newest version of livevalidation, generic lexapro, 1.3 is used in the plugin - so no additional tweaking is needed, generic lexapro, install and validate away ;-))

Surely I am not the only one who was a ‘bit nervous’ (that was a mild euphemism) when his carefully entered data disappeared after submitting a form to the server. Generic lexapro, Nowadays web applications are doing better than that - valid data is saved and only the problematic fields are pointed out.

Of course even that feels so 1990’s now. Generic lexapro, A contemporary (ehm… Generic lexapro, web 2.0?) web application is expected to validate the form on the client side already (WARNING! That doesn’t mean at all you shouldn’t validate on the server side though - client side validation is for the good guys but you should still look out for the script kiddies et al), generic lexapro, pointing out the errors on the fly so there is no need to come back and change/edit those fields after submitting a form.

My library of choice is livevalidation, generic lexapro, which has a Rails companion too - if you are using Rails form helpers and standard validation on your models, generic lexapro, you don’t have to touch anything just install livevalidation (=drop it to your javascripts folder, generic lexapro, it’s a single .js file). Generic lexapro, w00t!

The only major shortcoming (from my POV) of the Rails plugin is that validatesconfirmationof is not implemented. Generic lexapro, However, generic lexapro, it’s easy to add it via standard javascript:

<input id="user_password" name="user[password]" size="30" type="password" />
<input id="user_password_confirmation" name="user[password_confirmation]" size="30"> 
<script type="text/javascript">
var validate = new LiveValidation('user_password_confirmation');
validate.add( Validate.Confirmation, generic lexapro, { match: 'user_password' } );
</script>

That’s it!

One more note: the Rails plugin contains version 1.2 but there is a newer version, generic lexapro, 1.3 so be sure to replace it.

Similar Posts:buy viagra,generic lexapro,clonazepam no prescription,diazepam no prescription,buy viagra us

Cheapest zoloft

Sunday, June 10th, 2007

Cheapest zoloft, ubuntu In my quest to whip my feed reader’s Ruby/Rails related content into shape a bit, cheapest zoloft, I made a little research to find out which Ruby/Rails blogs are the most popular at the moment. Cheapest zoloft, I had given up on following most of the blogs systematically a long time ago - it is becoming increasingly hard to keep track of even the aggregators, cheapest zoloft, not to talk about the blogs themselves. Cheapest zoloft, There are hundreds of Ruby/Rails blogs out there right now (I am talking about the ones found on the few most popular aggregators - in reality there must be much more of them), cheapest zoloft, so it is clear that you need to pick carefully - unless you happen to be a well-paid, cheapest zoloft, full time Ruby/Rails blog reader (in which case you still would have to crank a lot to do your work properly).

Cheapest zoloft, OK, cheapest zoloft, enough nonsense for today - let’s see the results counting down from the 10th place! If you are interested in the method they were created with, cheapest zoloft, or a longer, cheapest zoloft, top 30 list from technorati and alexa, cheapest zoloft, check out this blog entry.

Cheapest zoloft, 10. Cheapest zoloft, http://weblog.jamisbuck.org/ by Jamis Buck.

jamisbuck

Cheapest zoloft, Jamis Buck “is a software developer who has the good fortune to be both employed by 37signals and counted among those who maintain the Ruby on Rails web framework”. Cheapest zoloft, He is mostly blogging about (surprise, cheapest zoloft, surprise!) Rails - of course on a very high level, cheapest zoloft, which could be expected from a Rails core developer. Cheapest zoloft, Very insightful posts on ActiveRecord, cheapest zoloft, Capistrano and other essential Rails topics delivered in a professional way.

Cheapest zoloft, 9. Cheapest zoloft, http://weblog.rubyonrails.org by the Rails core team

weblog_rubyonrails

Cheapest zoloft, This is the “default” Ruby on Rails blog, cheapest zoloft, used for announcements, cheapest zoloft, sightings, cheapest zoloft, manuals and whatever else the RoR team finds interesting :-).

Cheapest zoloft, 8. Cheapest zoloft, http://www.slash7.com by Amy Hoy.

slash7

Cheapest zoloft, This is a really cool little site - Amy is a very gifted writer and designer, cheapest zoloft, publishing very insightful articles as well as the nicest (hands down!) cheat sheets about different Web2.0, cheapest zoloft, Ajax, cheapest zoloft, Rails and that sort of stuff. Cheapest zoloft, Definitely worth checking out!

Cheapest zoloft, 7. Cheapest zoloft, http://errtheblog.com by PJ Hyett and Chris Wanstrath.

err_the_blog

Cheapest zoloft, A very serious blog of two Rails-geeks about advanced topics (but very well explained - so if you are not totally green (#00FF00) you should do fine). Cheapest zoloft, Among other things, cheapest zoloft, they have contributed Sexy Migrations to Rails recently.

Cheapest zoloft, 6. Cheapest zoloft, http://nubyonrails.com/ by Geoffrey Grosenbach

nubyonrails

Cheapest zoloft, Geoffrey is the author of more than twenty of Rails plugins, cheapest zoloft, (including gruff, cheapest zoloft, my favorite graph drawing gem), cheapest zoloft, a horde of professional-quality articles and the PeepCode screencast site. Cheapest zoloft, Do I need to say more?!

Cheapest zoloft, 5. Cheapest zoloft, http://redhanded.hobix.com/ by _why the lucky stiff.

redhanded

Cheapest zoloft, _why is probably the most interesting guy in the Ruby community. Cheapest zoloft, He is the author of (among tons of other things) Why’s Poignant Guide to Ruby, cheapest zoloft, HPricot, cheapest zoloft, the coolest Ruby HTML parser, cheapest zoloft, Try Ruby! (a must see!) and Hackety Hack, cheapest zoloft, for aspiring wannabe programmers who want to hack like in the movies! The list goes on and on… Cheapest zoloft, This guy never stops. Cheapest zoloft, If someone will ever invent the perpetuum mobile, cheapest zoloft, he will be it (in Ruby, cheapest zoloft, of course). Cheapest zoloft,

Cheapest zoloft, 4.http://hivelogic.com/ by Dan Benjamin.

hivelogic

Cheapest zoloft, Dan’s recent work include Cork’d, cheapest zoloft, a web2.0 wine community site or the A List Apart publishing system. Cheapest zoloft, He does great podcasts with various guys.

Cheapest zoloft, 3. Cheapest zoloft, http://mephistoblog.com/ by Rick Olson and Justin Palmer

mephisto

Cheapest zoloft, Personally I was quite surprised that a blog concentrating on such a narrow topic (in this case the mephisto blogging system) could grab the 3rd place - so I have checked both alexa and technorati by hand just to be sure, cheapest zoloft, and it seems that everything is OK - mephistoblog is ranked very high on both of them, cheapest zoloft, justifying this position. Cheapest zoloft, After all, cheapest zoloft, mephisto is the leading blog system of Rails!

Cheapest zoloft, 2. Cheapest zoloft, http://www.rubyinside.com/ by Peter Cooper.

rubyinside

Cheapest zoloft, This blog is my absolute favorite from this top 10 list (actually, cheapest zoloft, from all the Ruby blogs I have encountered so far). Cheapest zoloft, I am definitely with Amy Hoy, cheapest zoloft, who said If you had to subscribe to just one Ruby blog, cheapest zoloft, it should be this one. Cheapest zoloft, If you would like to know what’s happening in the Ruby/Rails community, cheapest zoloft, rubyinside is the place to check. Cheapest zoloft, If there is no new post here, cheapest zoloft, it’s because most probably nothing happened!

Cheapest zoloft, And the winner is: http://www.loudthinking.com/ by David Heinemeier Hansson.

loudthinking

Cheapest zoloft, Well, cheapest zoloft, what should I add? David is the author of Ruby on Rails, cheapest zoloft, so no wonder his blog topped the list!

Cheapest zoloft,
Conclusion
It’s interesting to note that nearly all the blogs listed here are mostly pure Rails ones - rubyinside (mixed Ruby/Rails) and redhanded (pure Ruby) being the two exceptions. Cheapest zoloft, It would be interesting to generate such a list for Ruby blogs - though I am not sure how. Cheapest zoloft, The sources I have used (most notably rubycorner) aggregate both Ruby and Rails blogs) - so it seems there are much more Rails bloggers out there (or they are much better (with the exception of _why) than the Ruby bloggers).

Cheapest zoloft, I would really like to hear your opinion on this little experiment - whether you think it makes sense or it is completely off, cheapest zoloft, how could it be improved in the future, cheapest zoloft, what features could be added etc. Cheapest zoloft, If I’ll receive some positive feedback, cheapest zoloft, I think I will work on the algorithm a bit more, cheapest zoloft, and run it once in say every 3 months to see what’s happening around the Ruby/Rails blogosphere. Cheapest zoloft, Let me know what do you think!


If one is thinking about creating a site for affiliate marketing to earn some extra cash they should thoroughly research a few things. Cheapest zoloft, To start with look for a cheap company that sell domains for your domain name registration. Cheapest zoloft, Next get a cheap, cheapest zoloft, yet reliable web hosting company to host your site on. Cheapest zoloft, These can be easily distinguished as they hire many cisco certified professionals. Cheapest zoloft, The generally carry 642-371 certifications. Cheapest zoloft, Then look into online backup for your files to avoid data loss. Cheapest zoloft, More over perform directory submission to get indexed in the search engines. Cheapest zoloft, Getting a+ certificate yourself is not a bad idea since it will help you get through the process with much ease.


Similar Posts:cheap xanax,cheapest zoloft,buy generic kamagra,cheapest soma,phentermine

Generic viagra

Wednesday, May 30th, 2007

Generic viagra, REST-cheatsheet If I had to choose the single most not-really-well-understood, generic viagra, mystified, generic viagra, unsuccessfully demystified, generic viagra, explained and still not-really-grasped topic in the Rails world (and beyond), generic viagra, my vote would definitely go to REST. Generic viagra, It seems to me that there are two types of people in the world: those who don’t get REST (and they think it’s a basic postulate to rocket science explained through quantum theory) and those who get it, generic viagra, and don’t understand the former group (unless they are coming from there, generic viagra, that is). Generic viagra,
I have been playing around with RESTful Rails recently. Generic viagra, Below is my collection or Rails REST howtos, generic viagra, tutorials and other resources I have found so far and which were adequate for my transition from the first group to the second :-).

Generic viagra, You should definitely begin with REST 101 - then check out the other stuff as well!

Generic viagra, Please leave a comment if you know some more (just for completeness’ sake - I think the above resources should be enough to grasp RESTful Rails both theoretically and practically.

Creating a site and uploading is considered to be the easy part these days. Generic viagra, Especially with languages like ruby on rails you can develop sites in no time. Generic viagra, Companies providing hosting services give you a wide variety of options to choose from for your hosting services such as asp hosting or php hosting. Generic viagra, Not only that but they also hire 350-040 certified to provide you quality services. Generic viagra, Then yahoo hosting provides simple methods for uploading site. Generic viagra, With the use of computer backup software you can easily avoid data loss. Generic viagra, The actual time consuming part is working on the site’s search engine ranking. Generic viagra, Not only does it take time but it is also expensive.

Similar Posts:viagra pharmacy,generic viagra,cheapest zithromax,buy cheap lexapro,phentermine without prescription

Tramadol prescription

Thursday, March 22nd, 2007

Tramadol prescription, Though dreamhost offers phpBB as one of their one-click install goodies (ergo it is the easiest to install of all forums since you almost don’t have to do anything), tramadol prescription, I have been looking for something different. Tramadol prescription, To me, tramadol prescription, phpBB’s interface was always quite unintuitive and too heavy - I wanted something smaller, tramadol prescription, easier, tramadol prescription, more compact. Tramadol prescription, The problem was I did not know what should I search for - until I came across beast, tramadol prescription, a lightweight forum written in Ruby on Rails. Tramadol prescription, It was love at the first sight!

Tramadol prescription, When it comes to tools I am using, tramadol prescription, I am really language agnostic - this very blog uses WordPress (PHP), tramadol prescription, I am using Trac (Python) to track my projects, tramadol prescription, mediaWiki (PHP) is my preferred wiki etc - so even if it may seem so, tramadol prescription, I did not choose beast because it is written in Rails (although +1 for that :-)), tramadol prescription, but because of the design and ease of use. Tramadol prescription, My first thought after trying it was ‘wow, tramadol prescription, this is as easy to use as a 37signals app’ - it’s really that intuitive and well designed!

Tramadol prescription, Well, tramadol prescription, this sounds fine and all, tramadol prescription, but installation on dreamhost was a different story. Tramadol prescription, Thanks God I have found a superb, tramadol prescription, step by step HOWTO here. Tramadol prescription, However, tramadol prescription, even after following all the steps, tramadol prescription, I got ‘incomplete headers’ and other problems, tramadol prescription, which I have managed to fix - here are some additional comments to the HOWTO:

Tramadol prescription, 6. Tramadol prescription, You can forget about this point; as the HOWTO says, tramadol prescription, it is already installed on DH and it will work without any problems.
7. Tramadol prescription, Forget about ‘development’ and ‘test’, tramadol prescription, however be sure to get ‘production’ right, tramadol prescription, as the next step will not work otherwise. Tramadol prescription, It should look something like this:

production:
  adapter: mysql
  database: beast_prod
  host: mysql.myhost.com
  username: us3r
  password: p4ss
  port: 3306
8. Tramadol prescription, For me it worked only *with* the RAILS_ENV=production parameter specified.
9. Tramadol prescription, You can change the salt to anything - it just must not stay the same. Tramadol prescription, The easiest thing is to add or remove a random character from the string.
12. Tramadol prescription, The shebang should be updated to #!/usr/bin/ruby
13. Tramadol prescription, The || should be removed, tramadol prescription, i.e. Tramadol prescription, it should read:
ENV[‘RAILS_ENV’] = ‘production’
14. Tramadol prescription, Make sure you change the permission of those directories only - I have changed everything recursively, tramadol prescription, destroying the executable flag of dispatch.fcgi :-).

Tramadol prescription, Now you should apply the ‘GetText patch’ - it can be found later in the thread. Tramadol prescription, After you should be up and running!

Tramadol prescription, After playing around, tramadol prescription, I have found that the user listing is not working - fortunately I have found this as well in the forum. Tramadol prescription, The solution is:
app/views/users/index.rhtml line 3 should be modified to

%lt;% form_tag '', tramadol prescription, :method => 'get' do -%>
Enjoy this great forum!

Similar Posts:cheapest soma,tramadol prescription,buy generic levitra,order xanax,order tramadol

Viagra pills

Wednesday, September 27th, 2006

I have just finished reading Ruby for Rails: Ruby techniques for rails developers from David A. Viagra pills, Black. Viagra pills, Here is my (WARNING: highly opiniated) review…

I have been a Python fanatic for quite some time, viagra pills, and decided to give Ruby a shot. Viagra pills, After some googling, viagra pills, I found most references pointing to a book called the ‘Pickaxe’. Viagra pills, Quite a strange name for a programming book, viagra pills, thought to myself, viagra pills, but picked it up nevertheless. Viagra pills, I have been instantly converted after a few dozen pages - mining Ruby with the pickaxe was an awesome experience! Since then, viagra pills, I have finished reading the second edition and became a Ruby enthusiast.

After lurking around a bit, viagra pills, I have learned that the common standpoint is that every newcomer/beginner should grab a copy of the Pickaxe to get started. Viagra pills, Based on my previous, viagra pills, positive experience I could not agree more - until I came across R4R.

Ruby for Rails is awesome: The technical depth is just right to not distract beginners, viagra pills, yet detailed enough for even the more advanced readers. Viagra pills, I did not skip a single page (though years of programming experience and tons of similar programming books I came across during that time could allow me) and finished reading it in no time. Viagra pills,

I could write some more about how cool this book is (and it would deserve every bit of it), viagra pills, but I think you can read about that just anywhere (a nice review can be found here), viagra pills, so I would like to point out something different: If we consider the Pickaxe THE book for newcomers, viagra pills, then IMHO R4R is a Pickaxe killer.

Don’t get me wrong: I am a great fan of the Pickaxe, viagra pills, which is another very high-quality technical book - but if someone wants to apply the ‘right tools for the right job’ principle, viagra pills, I think newcomers who already decided to learn Ruby should grab Ruby for Rails. Viagra pills, Programming Ruby’s Part I is absolutely well suited to get the ‘feeling’ of Ruby, viagra pills, and it’s next chapters are great to learn the advanced stuff - however in my opinion, viagra pills, the leap between the first and the next chapters is too big for an absolute beginner. Viagra pills, Ruby for Rails is there to fill this gap.

Maybe someone might not advice this book to a newbie eager to learn Ruby, viagra pills, since it has ‘Rails’ in it’s title. Viagra pills, However, viagra pills, R4R is still primarily a Ruby book, viagra pills, and while I found the Rails parts to be very helpful, viagra pills, I can recommend it to anyone who would not like to learn Rails at all - though the full potential of the book comes through if one would like to learn both.

Conclusion: Ruby for Rails is an awesome book on Ruby. Viagra pills, If you are beginner, viagra pills, would like to get a solid understanding of the Ruby principles, viagra pills, or your goal is to polish up your Ruby knowledge to grasp the Rails framework - R4R was made just for you! Check it out - you won’t be disappointed.

Similar Posts:cialis discount,viagra pills,viagra online cheap,buy generic accutane,generic lexapro

Xanax sale

Wednesday, June 14th, 2006

I am planning to write a series of entries on screen scraping, xanax sale, automated Web navigation, xanax sale, deep Web mining, xanax sale, wrapper generation, xanax sale, screen scraping from Rails with Ajax and possibly more, xanax sale, depending on my time and your feedback. Since these entries are going to be longer, xanax sale, I will be posting them to separate pages, xanax sale, and announce them on my blog.

The first article is ready, xanax sale, you can read it here.

It is an introduction to screen scraping/Web extraction with Ruby, xanax sale, evaluation of the tools along with installation instructions and examples.

Feedback would be appreciated (leave your comment here/on the article page, xanax sale, or send me a mail at peter@[name of this site].com), xanax sale, I will update/extend the document and publish new ones based on your feedback.

Similar Posts:cheap soma,xanax sale,valium for sale,generic xanax,phentermine no prescription

Generic viagra

Sunday, June 11th, 2006

Programming is great fun (mainly with Ruby ;-). Generic viagra, However, generic viagra, this statement does not contradict with the fact that sometimes programming can be also hard. Generic viagra, I came across a nice site today which can offer some help in these moments: Programming is hard. Generic viagra, Judging from the size of Ruby/Rails/ActiveRecord tags (there is even a script.aculo.us tag!) it seems that it has a nice dose of Ruby/Rails stuff - solutions for common problems and also links to tutorials, generic viagra, frequenty asked nuby questions etc. Generic viagra, Be sure to check it out!

Similar Posts:viagra generic,generic viagra,buy generic synthroid,sibutramine for sale,buy viagra online

Cheap zoloft

Wednesday, May 31st, 2006

Just two weeks after Ruby on Rails was featured in the prominent Dr Dobb’s Journal, cheap zoloft, it gets into the limelight again, cheap zoloft, in even greater power than before: Guess who is staring at you from the frontpage of Linux Journal? Yes, cheap zoloft, it’s DHH… Cheap zoloft, and the reason? The current issue is full of Ruby and Rails articles, cheap zoloft, tips and tricks etc. Cheap zoloft, Read the full story at David’s blog.

Similar Posts:cialis,cheap zoloft,generic viagra cheap,plavix pills,viagra india

Cheap phentermine

Sunday, May 21st, 2006

In my previous post on migrations i wrote that “…they are not covered in any of the basic books on RoR”. Cheap phentermine, Well, cheap phentermine, this statement does not hold anymore, cheap phentermine, since Agile Web Development with Rails, cheap phentermine, 2nd ed. is already creating the models with migrations.

While the last part of the post (why are migrations so cool) is still up-to-date, cheap phentermine, they way of creating migrations is different from 1.1 on, cheap phentermine, so i have decided to review the topic and add some new points, cheap phentermine, too.

Migrations are now created automatically with the model

In my previous post, cheap phentermine, i have been creating the migration manually with the command

ruby script/generate migration ProductMigration

However, cheap phentermine, as of Rails 1.1, cheap phentermine, you don’t have to do this anymore. Cheap phentermine, When you generate the model (let’s stick with the Product model as an example) the migration is automatically generated:

ruby script/generate model Product
...
... Cheap phentermine, #some lines omited
...
create db/migrate/001_create_products.rb

Now you can edit the file db/migrate/001createproducts.rb to contain something like this:

class ProductMigration < ActiveRecord::Migration
def self.up
create_table :products do |table|
table.column :title, cheap phentermine,       :string
table.column :description, cheap phentermine, :text
table.column :image_url, cheap phentermine,   :string end
(rest of the file omited)

Then run

rake db:migrate

To update the database. Cheap phentermine, That’s even easier than in the previous versions of rails!

Valid column data types and possible options

Valid columns are:

integer, cheap phentermine, float, cheap phentermine, datetime, cheap phentermine, date, cheap phentermine, timestamp, cheap phentermine, time, cheap phentermine, text, cheap phentermine, string, cheap phentermine, binary and boolean.

Valid column options:

  • limit ( :limit => “50” )
  • default (:default => “blah” )
  • null (:null => false implies NOT NULL)

string is the equivalent of varchar(255), cheap phentermine, so if you would like to have a string column (called title) of length 100 instead of 255, cheap phentermine, with default value ‘Some title’ and to forbid NULL value, cheap phentermine, you have to type

table.column :title, cheap phentermine,
:string, cheap phentermine,
:limit   => 100, cheap phentermine,
:default => "Some title", cheap phentermine,
:null    => false

Generating test data

I am quite sure you know the situation when you want to test something quickly and you waste precious time to generate some test data, cheap phentermine, which you trash after the testing just to find yourself in the same situation later?

Well, cheap phentermine, migrations can help you to prevent headaches because of this, cheap phentermine, too. Cheap phentermine, Here is how:

ruby script/generate migration create_test_data
Create db/migrate/002_create_test_data.rb

You can create test data inside the migration file like this:

class ProductMigration < ActiveRecord::Migration
def self.up
Product.create(:title => 'My cool book about the meaning of life', cheap phentermine,
:description => '42', cheap phentermine,
:image_url => /images/cool_book42.png)

You can now commit this migration to the RCS you are using, cheap phentermine, and modify/add more test data later.

The other advantage is that your colleagues won’t spend time writing dummy test data either: they can just check out this migration and happily use the provided tests.

If this is still not enough for you…

You can write SQL statements inside the migrations. Cheap phentermine, For example:

execute "alter table items
add constraint fk_items_products
foreign key (product_id) references products(id)"

However, cheap phentermine, use this with care since you have to write native DDL statements, cheap phentermine, which violates one of the fundamental ‘cool factors’ of migrations: independence from DB vendors.

Conclusion

The Agile Web Development with Rails, cheap phentermine, 2nd ed can be considered as the Rails bible and since it is promoting migrations as the definitive way to handle your DB issues, cheap phentermine, i think migrations will become (in fact the already did for lots of people) the state of the art. Cheap phentermine, After using them for a while and enjoying the power and flexibility they provide without having significant drawbacks, cheap phentermine, i don’t really see why should one not use them in the future.

Similar Posts:xanax pills,cheap phentermine,lorazepam online stores,valium for order,tramadol online

Discount zoloft

Friday, May 5th, 2006

As I wrote in my previous post, discount zoloft, I am currently reading/coding the depot example from the Agile Web Development with Rails book. Discount zoloft, I had one unclear issue so far - maybe someone can help me to find it out: I did something wrong or this is really a typo in the book?

Putting sessions in the database According to the book, discount zoloft, this should be done with

rake db:session:create

However, discount zoloft, after entering this command to the console I got:

(in /home/peter/development/src/railsprojects/depot)
rake aborted!
Don't know how to build task 'db:session:create'

After some playing with rake –help, discount zoloft, I have found the –tasks switch:

rake --tasks

and here I have finally found the remedy for my problem: the correct command is

rake db:sessions:create

(note the additional ’s’ character) Is this because my rake version is too old/too new or this is a typo in the book?

After this modification everything worked again as intended.

Similar Posts:cheap zoloft,discount zoloft,cheap zopiclone,buy kamagra,viagra for order


Bad Behavior has blocked 2386 access attempts in the last 7 days.