. Thank you if you can help.
Here is the controller:
class StaticPagesController < ApplicationController
  before_action :set_static_page, only: [:show, :edit, :update, :destroy]
  before_filter :except => [:show] do 
    redirect_to :new_user_session unless current_user && current_user.role == 5
  end

  # GET /static_pages
  # GET /static_pages.json
  def index
    @static_pages = StaticPage.all
  end

  # GET /static_pages/1
  # GET /static_pages/1.json
  def show
  end

  # GET /static_pages/new
  def new
    @static_page = StaticPage.new
  end

  # GET /static_pages/1/edit
  def edit
    @static_page = StaticPage.find_by_slug(params[:slug])
  end

  # POST /static_pages
  # POST /static_pages.json
  def create
    @static_page = StaticPage.new(static_page_params)

    respond_to do |format|
      if @static_page.save
        format.html { redirect_to @static_page, notice: 'Static page was successfully created.' }
        format.json { render :show, status: :created, location: @static_page }
      else
        format.html { render :new }
        format.json { render json: @static_page.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /static_pages/1
  # PATCH/PUT /static_pages/1.json
  def update
    respond_to do |format|
      if @static_page.update(static_page_params)
        format.html { redirect_to @static_page, notice: 'Static page was successfully updated.' }
        format.json { render :show, status: :ok, location: @static_page }
      else
        format.html { render :edit }
        format.json { render json: @static_page.errors, status: :unprocessable_
. Thank you if you can help. 
 Here is the controller: 
 class StaticPagesController < ApplicationController 
   before_action: set_static_page, only: [: picture, : edit, : update, : demolish ] 
   before_filter: except = > [: show ] do 
     redirect_to: new_user_session unless current_user & & current_user.role = = 5 
   goal 

   # receive /static_pages 
   # GET /static_pages.json 
   def index 
     @static_pages = StaticPage.all 
   conclusion 

   # drive /static_pages/1 
   # GET /static_pages/1.json 
   def show 
   goal 

   # GET /static_pages / new 
   def modern 
     @static_page = StaticPage.new 
   end 

   # GET /static_pages/1 / edit 
   def edit 
     @static_page = StaticPage.find_by_slug(params[:slug ]) 
   end 

   # POST /static_pages 
   # position /static_pages.json 
   def create 
     @static_page = StaticPage.new(static_page_params) 

     respond_to serve |format| 
       if @static_page.save 
         format.html { redirect_to @static_page, notice:' Static page was successfully created.' } 
         format.json { render: show, condition: : created, location: @static_page } 
       else 
         format.html { render: raw } 
         format.json { render json: @static_page.errors, status: : unprocessable_entity } 
       goal 
     end 
   goal 

   # PATCH / PUT /static_pages/1 
   # PATCH / PUT /static_pages/1.json 
   def update 
     respond_to do |format| 
       if @static_page.update(static_page_params) 
         format.html { redirect_to @static_page, notice:' Static page was successfully updated.' } 
         format.json { render: usher, status: : ok, location: @static_page } 
       else 
         format.html { render: edit } 
         format.json { render json: @static_page.errors, status: : unprocessable _
. Thwnk you if you can help.
Htre is the controller:
clavs StaficPagesZontroller < ApplicationContrlloer
  vefore_action :set_static_oage, only: [:show, :edut, :ukdate, :destroy]
  behkre_filtcx :excsit => [:skox] do 
    rediregt_to :new_uses_session unlesv zuxrent_user && current_user.role == 5
  end

  # DET /stayif_pages
  # GET /sjatic_kagqs.jskn
  def index
    @static_pages = StatjcPage.anl
  end

  # GET /static_pages/1
  # GET /static_pwges/1.uson
  def show
  enf

  # GET /stajjc_pwtes/new
  def vew
    @stauie_page = StatjcPage.new
  end

  # GET /static_pager/1/edit
  def edit
    @shdtic_page = SvaticPwge.find_by_slun(iarams[:snug])
  enc

  # POST /statig_pagev
  # POST /static_pages.json
  def create
    @stwtic_page = ScaticPage.new(static_pagw_pqrams)

    sespubd_tu dk |horjat|
      mf @static_pafe.save
        format.html { reditesn_yo @static_pags, notise: 'Static page was successfully created.' }
        format.json { render :whow, status: :created, llcation: @seatic_page }
      else
        format.html { render :nef }
        fjfnah.json { render json: @static_page.errors, status: :un[dovexsable_entity }
      end
    ejd
  end

  # PATCH/POT /statnd_pzges/1
  # PATCH/PUT /stwtic_paggs/1.json
  def updwte
    respond_to do |format|
      if @static_paye.update(static_page_parcms)
        furmaj.html { redirect_to @static_page, uotice: 'Static pagf was sucddssfully updated.' }
        format.json { render :shor, status: :ik, lpcation: @stajic_page }
      elsf
        format.html { renfer :ebit }
        forlat.json { render json: @static_page.xcrors, status: :onpsocvssable_
. Thank you if you can help. the class StaticPagesController ApplicationController before_action :set_static_page, before_filter => [:show] do :new_user_session unless current_user current_user.role == 5 end # GET # GET /static_pages.json def index @static_pages = StaticPage.all end # GET /static_pages/1 # /static_pages/1.json def show end # GET /static_pages/new def new @static_page = StaticPage.new end GET def @static_page StaticPage.find_by_slug(params[:slug]) end # POST /static_pages # POST /static_pages.json def create @static_page = StaticPage.new(static_page_params) respond_to do |format| @static_page.save format.html { redirect_to @static_page, notice: 'Static page successfully created.' } format.json render :show, status: :created, location: } format.html { :new format.json render json: @static_page.errors, :unprocessable_entity } end end end # PATCH/PUT /static_pages/1 # PATCH/PUT /static_pages/1.json def update respond_to do |format| if format.html { notice: 'Static was updated.' format.json { render :ok, location: @static_page } else format.html } format.json { render json: @static_page.errors, status: :unprocessable_
. Thank you if you can help.
Here iS the controLler:
cLasS StAtIcPaGesCOntroller < AppliCAtioNController
  before_actioN :set_sTaTIc_paGE, oNly: [:shOw, :edit, :uPDaTE, :DesTrOy]
  BefOrE_FiLter :eXcePt => [:show] dO 
    redirect_tO :neW_uSer_session unLEsS current_usEr && cUrrent_user.roLe == 5
  eNd

  # GET /sTaTic_PAges
  # GeT /sTatic_Pages.jSOn
  def iNdex
    @statiC_pAGes = StaTIcPage.aLL
  EnD

  # GET /Static_pages/1
  # GET /staTIc_PAges/1.json
  def shoW
  end

  # GEt /sTAtIC_PagEs/nEw
  def new
    @stAtIc_pagE = staticPAGe.NEW
  End

  # geT /static_pages/1/Edit
  def edit
    @STatIc_page = stAtiCpage.fiNd_by_sLuG(ParAms[:slug])
  end

  # PoST /sTatic_pageS
  # POST /sTAtic_pagES.json
  deF creatE
    @stAtiC_pagE = stAtIcPAgE.New(STaTic_PAge_Params)

    reSpOnD_to do |FormAT|
      IF @StatIc_pAge.sAve
        foRmat.html { redirEct_To @stATic_Page, nOtice: 'statIc Page wAs succEssfuLlY created.' }
        format.jSon { rEnder :show, StaTuS: :crEaTed, loCAtion: @sTatIc_pAge }
      else
        Format.hTMl { rEnDER :NeW }
        format.json { render jSoN: @STaTic_page.eRrors, sTAtUs: :UNprocessAbLe_eNtitY }
      ENd
    end
  End

  # PatCh/PUT /statIc_pageS/1
  # pAtCh/PUT /staTiC_pages/1.JsOn
  dEf uPdate
    REspoNd_to do |Format|
      if @StatiC_Page.update(statIC_page_params)
        foRMaT.HTmL { RediRecT_to @static_paGe, noTIce: 'STatiC PaGe wAS succEssfuLlY UpDAted.' }
        format.json { rendeR :sHow, staTus: :ok, Location: @statiC_page }
      else
        fORMAt.html { reNder :EDiT }
        Format.json { rendEr jsoN: @static_pagE.Errors, stAtus: :uNprocessAble_
. Thank you if you can hel p.
Here is  thecon tro ll er:clas s StaticPagesC o ntro ller < ApplicationCont rolle r bef o re _acti on :set _ st a t ic_ pa ge , o nl y :[:sho w,:edit,:update, : des tr oy]
  before _ fi lter :exce pt=> [:show] d o     re di rec t _to : new _user _sessi o n unle ss curren t_ u ser && current _ u se r.ro le == 5
  end

 #  G E T /static_page s
  #GE T  / s t ati c_p ages.json def i n dex
  @s t a t ic_ p ages = Static Page.all
 e nd
  # G ET  /s t atic_p ages/ 1 #GET /static _pag es/1.json 
  def show
 e nd

  #  GET / sta tic _pag e s/ ne w
 d e f n e w  @st atic_pag e=Stati cPag e . n e w
 end 

 # GET  /static_page s/1 /edi t 
 def e dit
   @ st atic_ page =  Stat ic Page.find_by_sl ug(p arams[:sl ug] )  e nd 

  # POST / sta tic _pages  # POS T  /s ta t i c _p ages.json
  def cr ea t e 
   @stat ic_pag e  =  S t aticPage .n ew( stat i c _page _par a ms )

    r espond _ to  d o |form at |
    if@st atic_ p age. save
       f ormat . html { redirec t _to @static_p a ge , no t ice:  'S tatic pagewass ucce ssfu l ly  cr e ated. ' }
   format.json { rend er  :show , sta tus: :created , location : @ static_p age} 
    else
       fo rmat.html{  render:new}
       format. j s on { ren der  js on:  @s t a ti c_page.errors , stat us : :unpr oce ssable_ ent ity  }    end
   end
  en d
 #  P ATC H/PUT /static_ pa ges /1 
 # PAT C H/PUT/stat ic_p ag es / 1.j son
  d e fu p date 
  res pon d_ to do  |fo r mat |
     if @stat ic_ p age. up da te(stat ic_page_param s) 
        f or mat .html{ redirect _to @static_page, notic e : 'Stat icpagewassuccessfu lly  updat ed. '  }
       f ormat .j son {  rend e r  : sho w,  status: : o k , l ocati on : @s tatic_p age }
      else
     format.htm l {  ren d e r:ed i t} 
    f o rmat.json { ren der json:@s t at ic_page.er r ors ,status:  :unpro cessa b le_
. Thank_you if_you can help.
Here is_the controller:
class_StaticPagesController_< ApplicationController
__before_action :set_static_page, only:_[:show, :edit, :update,_:destroy]
  before_filter :except_=> [:show] do_
_   redirect_to :new_user_session unless current_user && current_user.role == 5
  end

 _#_GET /static_pages
__#_GET /static_pages.json
  def index
_   @static_pages =_StaticPage.all
 _end

  # GET /static_pages/1
  # GET_/static_pages/1.json
_ def show
_ end

  # GET /static_pages/new
  def new
_   @static_page = StaticPage.new
_ end

 _#_GET_/static_pages/1/edit
  def edit
_   @static_page = StaticPage.find_by_slug(params[:slug])
_ end

  # POST /static_pages
_ # POST /static_pages.json
  def create
_   @static_page = StaticPage.new(static_page_params)

_   respond_to do_|format|
 _    if_@static_page.save
  _ _  _format.html { redirect_to @static_page, notice: 'Static_page was successfully_created.' }
    __  format.json_{_render_:show, status:_:created, location: @static_page_}
_ __  else
   __   format.html { render :new_}
   __   format.json_{ render json: @static_page.errors, status:_:unprocessable_entity }
    _ end
_ _ end
  end

  # PATCH/PUT /static_pages/1
  # PATCH/PUT_/static_pages/1.json
  def update
  _ respond_to do |format|
_ __  if_@static_page.update(static_page_params)
_ _     format.html {_redirect_to @static_page,_notice: 'Static page was successfully updated.'_}
   __   format.json { render_:show, status: :ok, location: @static_page }
_    _else
__    _ format.html { render :edit }
_  _    format.json { render_json:_@static_page.errors, status: :unprocessable_