当前方法的controller_name和model_name

   def this_class(s=self.controller_name)
      s.classify.constantize
    end

   
 <%@menus.each_with_index do |m,i|%>
	<li><span><a href="/<%=@path%>/<%=i+1%>" class="cate_title"><%=m%></a>
	        		<%=image_tag "/images/company_desc/sj.png",:class=>"menu_sj" if i+1 == mid%></span></li> 
        	<%end%>


   def entered(record)
            afteractions = @opts[:after]
            return unless afteractions
            Array(afteractions).each do |afteract|
              record.send(:run_transition_action, afteract)
            end
    end


  def run_transition_action(action)
    
    Symbol === action ? self.method(action).call : action.call(self)
        
   end
 

你可能感兴趣的:(controller)