January 25, 2012 at 1:57 am · Filed under Ruby on Rails
The delete methods bypass the various Active Record callback and validation functions, while the destroy methods ensure that they are all invoked. In general, it is better to use the destroy methods if you want to ensure that your database is consistent according to the business rules defined in your model classes.
Permalink
December 13, 2011 at 3:26 am · Filed under Web Development
Windows Internet Explorer 9 introduces pinned sites, a feature with which you can integrate your websites with the Windows 7 desktop. With pinned sites enabled for a website, users can pin that site to the Windows 7 taskbar or add the site to the desktop or Start menu. Pinned sites enable easy access to favorite websites and add shortcut functionality similar to that found in Microsoft Windows applications.
The following code example uses meta elements to customize the pinned site shortcut with a name, tooltip, start URL, initial window size, and navigation button color.
- Name the Pinned Site for Windows
Without this rule, Windows will use the page title as the name for your application.
<meta name="application-name" content="Sample Title">
- Give Your Pinned Site a TooltipYou know — a tooltip. A little textbox that appears when the user holds their mouse over your Pinned Site’s icon.
<meta name="msapplication-tooltip" content="A description of what this site does.">
- Set a Default Page for Your Pinned Site
If the site should go to a specific URL when it is pinned (such as the homepage), enter it here.
<meta name="msapplication-starturl" content="http://www.example.com/index.html?pinned=true">
- Recolor Internet Explorer’s Controls Manually
IE9 will automatically use the overall color of your Pinned Site’s favicon to shade its browser buttons. UNLESS you give it another color here. Only use named colors (“red”) or hex colors (“#f00″).
<meta name="msapplication-navbutton-color" content="#f00">
- Manually Set the Window Size of a Pinned Site
If the site should open at a certain window size once pinned, you can specify the dimensions here. It only supports static pixel dimensions. 800×600 minimum.
<meta name="msapplication-window" content="width=800;height=600">
- Jump List (Right-Click) “Tasks”
Add Jump List Tasks that will appear when the Pinned Site’s icon gets a right-click. Each Task goes to the specified URL, and gets its own mini icon (essentially a favicon, a 16×16 .ICO). You can add as many of these as you need.
<meta name="msapplication-task" content="name=Task 1;action-uri=http://host/Page1.html;icon-uri=http://host/icon1.ico">
<meta name=”msapplication-task” content=”name=Task 2;action-uri=http://microsoft.com/Page2.html;icon-uri=http://host/icon2.ico”>
Reference:
- Pinned Sites: Windows 7 Desktop Integration with Internet Explorer 9
- IE9 Pinned Sites
Permalink
December 6, 2011 at 1:37 am · Filed under Web Development
By using this nifty protocol-relative URL trick
Permalink
November 30, 2011 at 4:27 pm · Filed under Web Development
web.config configuration best practice rules for making web pages fast and secure
Permalink