Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed 

MailMan listserve signup template

Simple template for adding a MailMan mailing list subscribe form to a page. Found on a mailing list somewhere a long time ago and cleaned up dramatically.

Note: I almost always just include the email and digest options, but I've included the whole spiel for completeness.


<h2>Join the XYZ listh2>

/mailman/subscribe/LISTNAME">

Your E-mail address: "text" name="email" size="30" value="">
Your Name (optional): "text" name="fullname" size="30" value="">

You may enter a privacy password below. This provides only mild security, but should
prevent others from messing with your subscription. Do not use a valuable password as it
will occasionally be emailed back to you in cleartext.

If you choose not to enter a password, one will be automatically generated for you, and it will
be sent to you once you've confirmed your subscription. You can always request a mail-back
of your password when you edit your personal options.

Password choice: "password" name="pw" size="15">
Confirm Password: "password" name="pw-conf" size="15">

Would you like to receive list mail batched in a daily digest? (You may choose NoMail after you join.)
"radio" name="digest" value="0" checked> No "radio" name="digest" value="1"> Yes

"submit" name="email-button" value="Subscribe">


default layout for a controller

// description of your code here
In your controller add the name of the .rhtml file in /apps/layouts/ that you want to use, without the suffix (.rhtml).
When rails spits out your view, it will use this given layout as the container for your rendered action.
layout ""

XHTML 1.0 Strict template

// So I can stop typing it. Includes the basic DIVs I aways seem to use.

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>title>

/html; charset=UTF-8" />
"imagetoolbar" content="no" />
"MSSmartTagsPreventParsing" content="true" />
"stylesheet" type="text/css" href="/styles/main.css" type="text/css" media="screen, projection" />


"stylesheet" type="text/css" href="/styles/print.css" type="text/css" media="print" />


"page">
"header">

Header

"content">
"footer">

Footer

« Newer Snippets
Older Snippets »
3 total  XML / RSS feed