Dear friends,

I have a method named show_rosterduty in employee controller and and a
view name show_rosterduty.html.erb

in the authorization_rules I already set the name of method along with
other methods of employee, means below the method add_rosterduty.

but it give me the error:

Sorry, you are not allowed to access that page

here are the methods below:

######### Roster Duty #########
def add_rosterduty
   @rosterduty = RosterDuty.new(params[:rosterduty])
   #logger.info( "Employee: #{@employee.inspect}")
   @employee = Employee.find(params[:id])
    if request.post? and @rosterduty.save
      flash[:notice] = t('flash1')
      redirect_to :controller => "employee", :action =>
"add_rosterduty", :id => @employee.id and return
    end
end

def show_rosterduty
    @rosterduty = RosterDuty.find(params[:id])
    @employee = Employee.find(params[:id])
    respond_to do |format|
      format.html # show_rosterduty.html.erb
      format.xml  { render :xml => @rosterduty }
    end
  end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9fb137d5c27da48870ea58bad9446e57%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to