NoMethodError in StatusesController index

You may run into undefined method `attr_accessible'  error message when adding restrictions on what attributes of the object can or cannot be accessed. This error is due to deprecation of the restriction mechanism in newer Rails 4 framework. You either need to remove it and use restrictions inside your controller not a model

class StatusController<ApplicationController
def create Status.create(status_params)
end private def status_params params.require(:status).permit(:title,:content)
end
end

It is important to note that without setting properties to permit will prevent Rails from adding relationships so you'll need to authorize foreign keys in here as well. 
 

Featured pages

Ruby

Set of Ruby Object Oriented Programming Language tutorials that cover such topics as Ruby strings, …

Rails

Rails Framework tutorial teaches you how to utilize de facto framework of choice for Ruby developme…

Ruby Duck Typing

“If an object quacks like a duck just go ahead and treat it as a duck” – this fun…

Regular Expressions

Ruby uses the =~ operator to check any given string against regular expression. For example, a stri…

Credit Card Number

Every last digit of any credit card is a check sum digit that is determined by all digits in front …

Ruby Arrays

Ruby Programming Language has built in support for Arrays. Arrays help you define some of the compl…

Ruby Hashes

Hashes are very similar to arrays in Ruby and hashes interface is similar to Ruby array interface. …

Ruby Code Block

Ruby is very unique language when it comes to code blocks. You can simply pass a code block to a me…