Sorry, you are not allowed to access that page

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

On 8 March 2016 at 07:38, Naveed A. [email protected] wrote:

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

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

You are right I am new to Rails programming, and I am editing/updating
an existing app for my organization, I am learning along with work but
due to lack of time I cant learn quickly, and also there is too many
things different from Rails version to version.

Anyway thanks a lot the problem resolved now. It was before filter
issue.

On 8 March 2016 at 09:07, Naveed A. [email protected] wrote:

You are right I am new to Rails programming, and I am editing/updating
an existing app for my organization, I am learning along with work but
due to lack of time I cant learn quickly, and also there is too many
things different from Rails version to version.

That’s OK, I am sure people here will continue willingly to give their
time freely so that your organisation can save on the cost of training
you in the basics of Ruby and Rails.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs