I’ve seen a few people asking me how to specify a specific layout in their controllers. Simple:
1 2 3 4 | #my admin/condos_controller.rb class Admin::CondosController < ApplicationController layout 'layouts/admin' end |
I’ve seen a few people asking me how to specify a specific layout in their controllers. Simple:
1 2 3 4 | #my admin/condos_controller.rb class Admin::CondosController < ApplicationController layout 'layouts/admin' end |
{ Comments }
Whereas, if you didn’t have this breadcrumb trail, you could quite possibly be losing indexable pages.
{ Comments }
Reminiscent of Google Webmaster, MSN Live has rolled out a set of webmaster tools to aid webmasters with crawling, indexing, and some other miscellaneous statistics. Some of the features MSN offers include:
I don’t think it’s anything exciting, but we’ll see what MSN has in store…but take a look yourself, at: webmaster.live.com
{ Comments }
I made a recent post on 301 redirects in Rails, new to 2.0 we have a few more methods available to us.
1 | # prior method<br>headers["Status"] = "301 Moved Permanently"<br>redirect_to "/"<br><br># condo has been defined as a resource in my route.rb<br>redirect_to condo_url(@condo), :status => 301<br>redirect_to condo_url(@condo), :status=> :moved_permanently<br> |
{ Comments }
Have an array that needs sorting? Perhaps you have a range of condominiums and you want to know the highest and lowest priced properties? Check it.
1 2 3 4 5 6 7 8 | # here's my array @condo_prices = [1000, 75, 2000, 10000] # returns 75 @condo_prices.min # returns 10000 @condo_prices.max |
{ Comments }
301 redirects are one of the best ways to inform search engines that your URLs have changed. They’re simple to implement, so you should have no reason not to use them.
1 | headers["Status"] = "301 Moved Permanently"<br>redirect_to "/"<br> |
Done.
{ Comments }
Google is constantly experimenting with new features aimed at improving your search experience. They have recently created the Google Experimental Search page which allows you to try out some of the new features. You can experience search results in exciting new ways. Here are a few of the features they recently added:
• Alternate views for search results (See results on a timeline, map, or in context of other information types.)
• Keyword Suggestions
• Keyboard Shortcuts
• Left-hand Search Navigation
• Right-hand Contextual Search Navigation
Join any of the listed experiments and you’ll be able to see that feature whenever you do a Google search. I have been wondering why they haven’t just included some of the Google suggests features that the Google toolbar has on the main Google search. I like when it completes the searches with keywords that I am most likely to use and pulls from my search history as well.
{ Comments }
One of the sites we’re working on sends an email upon the completion of a registration form. We were having problems with different SPAM filters catching and misflagging our emails. After doing a little research, it looks like we were omitting some important fields. Take a look at the before and after implementation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # before # note the lack of headers, sent on, and content type declarations class Postoffice < ActionMailer::Base def welcome(email) @recipients = email @from = "Meeta Support <happy2help@meeta.com>" @subject = "Welcome to Meeta.com" body[:email] = email end def contact(params) end end # after class Postoffice < ActionMailer::Base protected def welcome(email) @recipients = email @from = "Meeta Support <happy2help@meeta.com>" headers "Reply-to" => "happy2help@meeta.com" @subject = "Welcome to Meeta.com" @sent_on = Time.now @content_type = "text/html" body[:email] = email end end |
{ Comments }
Let’s face it, most of us creating apps collect at a very minimum a name and email address. By a simple validation method to our model, we can easily check the length, format, and presence of our fields. Checking the format of an email address is also simple, but requires a little more work. Using validates_format_of we are able to validate an email address against a regular expression (RegEx).
1 2 3 4 5 | # our User model class User < ActiveRecord::Base validates_presence_of :email validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i end |
Read up on validations at the Rails API
Read up on regular expressions
{ Comments }
Why would Google be wasting their time trying to block the Microsoft / Yahoo deal? We as consumers need another search solution and another good PPC search option other then Google. Google has been buying up companies left and right and there hasn’t be any issues with that. I was really excited about this news since I have been a little dissappointed with both providers lately. Microsoft needs more search volume and Yahoo needs more eyeballs for their portal.
It has been interesting seeing both portals grow over the past 5 or so years with two different strategies. Yahoo has opted to buy companies like Flickr, Blue Lithium, del.icio.us, Overture, Musicmatch and other websites that offer complimentary services that Yahoo decided not to build. MSN instead decided to partner with sites to offer products and services like CitySearch for City Guides, Match.com for Dating & Personals and Career Builder for their Jobs channel. MSN recently purchased aQuantive, Inc. for $6 billion to extend their ad network with Atlas, DrivePM and the Avenue A / Razorfish ad agency. They were already pretty aligned with aQuantive using them to serve up ads on their performance network. I hope that the Microsoft / Yahoo deal goes through as it will streamline a ton of inefficiencies that both Yahoo and Microsoft have had in Advertising. Yahoo has been a weak publisher to deal with on the display media side of things and MSN has been weak in the search side of the biz.
By ANDREW ROSS SORKIN AND MIGUEL HELFT THE NEW YORK TIMES
Standing between a marriage of Microsoft Corp. and Yahoo may be the technology giant that has continually outsmarted them: Google.
· What would stay, what would go if Yahoo takes Microsoft’s offer?
In an unusually aggressive effort to prevent Microsoft from moving forward with its $44.6 billion hostile bid for Yahoo, Google emerged over the weekend with plans to play the role of spoiler.Publicly, Google came out against the deal, contending in a statement that the pairing, proposed by Microsoft on Friday in the form of a hostile offer, would pose potential threats to competition that need to be examined by policymakers around the world.
Privately, Google went much further. Its chief executive, Eric Schmidt, placed a call to Yahoo’s chief, Jerry Yang, offering the company’s help in fending off Microsoft, possibly in the form of a partnership between the companies, people briefed on the call said.
Yahoo declined to comment Sunday. Microsoft said, as it did Friday when it made the bid, that the merger would lead to more, not less, competition.
“The combination of Microsoft and Yahoo will create a more competitive marketplace by establishing a compelling No. 2 competitor for Internet search and online advertising,” Brad Smith, Microsoft’s general counsel, said in a statement. “The alternative scenarios only lead to less competition on the Internet.”
{ Comments }