Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Ruby On Rails
  4. Ruby on Rails:ForbiddenAttributesError

Ruby on Rails:ForbiddenAttributesError

Scheduled Pinned Locked Moved Ruby On Rails
rubyhelpdatabase
8 Posts 2 Posters 282 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sangaur
    wrote on last edited by
    #1

    Hi everyone I am new to RoR and i am struck in a problem . I am trying to build a project named "new post" but i am getting an error named as ForbiddenAttributesError in file named as Post Controller. code written in that file is as follows: ========================================================= class PostsController < ApplicationController def new end def create @post= Post.new(params[:post]) @postsave redirect_to @post end private def post_params params.require(:post).permit(:title, :text) end def show @post=Post.find(params[:id]) redirect_to @post end def index @posts= Post.all end end ========================================================== Thanks

    M 1 Reply Last reply
    0
    • S sangaur

      Hi everyone I am new to RoR and i am struck in a problem . I am trying to build a project named "new post" but i am getting an error named as ForbiddenAttributesError in file named as Post Controller. code written in that file is as follows: ========================================================= class PostsController < ApplicationController def new end def create @post= Post.new(params[:post]) @postsave redirect_to @post end private def post_params params.require(:post).permit(:title, :text) end def show @post=Post.find(params[:id]) redirect_to @post end def index @posts= Post.all end end ========================================================== Thanks

      M Offline
      M Offline
      Member 11322475
      wrote on last edited by
      #2

      is this working?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sangaur
        wrote last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S Offline
          S Offline
          sangaur
          wrote last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • S Offline
            S Offline
            sangaur
            wrote last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • S Offline
              S Offline
              sangaur
              wrote last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • S Offline
                S Offline
                sangaur
                wrote last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sangaur
                  wrote last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • A Andre Oosthuizen referenced this topic
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups