<commit_before>class PagesController < ApplicationController

  before_filter :authenticate_admin!, :only => :destroy
  before_filter :authenticate_user!, :except => [:show]

  before_filter :find_page, :only => [:show, :edit, :update]

  respond_to :html, :json

  def about
    @organisations_count = Organisation.count
  end

  def show
    respond_with(@page)
  end

  def index
    @pages = Page.order(:slug)
  end

  def new
    @page = Page.new
  end

  def create
    @page = Page.new(params[:page])

    if @page.save
      redirect_to pages_path
    end

  end

  def update
    if @page.update_attributes(params[:page])
      redirect_to :action => :show, :id => @page.slug
    end
  end

  protected

    def find_page
      @page = Page.find_by_slug!(params[:id])
    end

end<commit_msg>Fixed save pages form submit params<commit_after>class PagesController < ApplicationController

  before_filter :authenticate_admin!, :only => :destroy
  before_filter :authenticate_user!, :except => [:show]

  before_filter :find_page, :only => [:show, :edit, :update]

  respond_to :html, :json

  def about
    @organisations_count = Organisation.count
  end

  def show
    respond_with(@page)
  end

  def index
    @pages = Page.order(:slug)
  end

  def new
    @page = Page.new
  end

  def create
    @page = Page.new(params[:page])

    if @page.save
      redirect_to pages_path
    end

  end

  def update
    if @page.update_attributes(page_params)
      redirect_to :action => :show, :id => @page.slug
    end
  end

  protected

    def find_page
      @page = Page.find_by_slug!(params[:id])
    end

  private

    def page_params
      params.require(:page).permit(
        :name,
        :slug,
        :body)
    end

end
{'fraction_non_alphanumeric': 0.1038439472174412, 'fraction_numerical': 0.0, 'mean_word_length': 2.892857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7040083', 'n_tokens_mistral': 604, 'n_tokens_neox': 568, 'n_words': 146}