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 »
1 total  XML / RSS feed 

_author_form.rhtml

// description of your code here
_author_form.rhtml
partial that handles the author name portion of a message entry form.

<%= error_messages_for 'message' %>

  <!--[form:author]-->

  <p/><label for="author_name">Author</label><br/>
  <% if !@logged_in then %>
    <%= text_field(:author, :name, :size => 30, :maxsize => 80, :disabled => !@logged_in) -%><br/>
    <em><%= link_to('Login', :controller => :account, :action => :login)-%> or 
      <%= link_to('Create an account', :controller => :account,
        :action => :signup) %> to use your own author name!</em><br/>
  <% elsif (@user_authors.nil? and @user_authors.length > 0) then %>
    <%= collection_select(:message, :author_id, @user_authors, :user_id, :name) %><br/>
    (<em>or create a new authorname</em>)
    <%= text_field(:author, :name, :size => 30, :maxsize => 80, :disabled => !@logged_in) -%><br/>
  <% else %>
    <%= text_field(:author, :name, :size => 30, :maxsize => 80, :disabled => !@logged_in) -%><br/>
  <% end %>
  <!--[eoform:author]-->
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed