On 8 March 2016 at 07:38, Naveed Alam <li...@ruby-forum.com> wrote:
> 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

Probably a before-filter is not allowing access.  Have a look in the
log for clues.

Am I right in thinking that you are an inexperienced developer who has
been given the job of maintaining an existing app?  If so then I think
it would be well worth your while taking some time out to learn the
basics of rails before continuing.  If you are being employed to do
this then tell your employer.  Otherwise I suggest starting with the
tutorial at railstutorial.org, which is free to use online.

Colin

>
> 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.

-- 
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/CAL%3D0gLvZo4jPt12xPEtpVn71VVOa2THTUh9mW9jCAa7gWKwVhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to