课程通知

<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>

<%=h @news.title %>

<%= watcher_link(@news, User.current) %> <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'talk_edit fr', :accesskey => accesskey(:edit), :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @course) %> <%= delete_link(news_path(@news),:class => 'talk_edit fr') if User.current.allowed_to?(:manage_news, @course) %>
<%= textilizable(@news, :description) %>
<%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
<%= link_to_attachments @news %>
<% if @news.commentable? %>

添加评论

<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
<%= text_area 'comment', 'comments', :placeholder=>"最多250个字"%>

<%= submit_tag l(:button_add) %> <%= l(:label_cancel_with_space) %> <%= l(:label_comment_with_space) %>

<% end %>
<% end %>
gugu012014-10-24

我写了一个验证身份证号码的程序,它是以一定内存空间(大概100M)换取cpu消耗,然后它的运算量就降低了,前十四位的验证就相当于转换类型再查表一样,所以它的验证号码速度比一般的方式快。如果还不明白就说明你写框架写多了,或者

<%= watcher_link(@news, User.current) %> <%= link_to(l(:button_edit), edit_news_path(@news), :class => 'icon icon-edit', :accesskey => accesskey(:edit), :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @course) %> <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @course) %>

<%=h @news.title %>

<% if authorize_for_course('news', 'edit') %> <% end %>
<%= textilizable(@news, :description) %>
<%= link_to_attachments @news %>
<% html_title @news.title -%> <% content_for :header_tags do %> <%= stylesheet_link_tag 'scm' %> <% end %>

<%= l(:label_comment_plural) %>

<% comments = @comments.reverse %> <% comments.each do |comment| %> <% next if comment.new_record? %>
<%= image_tag(url_to_avatar(comment.author), :class => "avatar")%>
<%= link_to_user(comment.author) if comment.respond_to?(:author) %> <%= l(:label_project_newadd) %><%= l(:label_comment_plural) %>
<%= textilizable(comment.comments) %>
<%= format_time(comment.created_on) %> <%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<% end if @comments.any? %>