Warning: Undefined array key "HTTP_REFERER" in /home/u522501990/domains/makemeengr.com/public_html/wp-content/themes/generatepress/generatepress.theme#archive on line 43

Rails 4.0 Strong Parameters nested attributes with a key that points to a hash

My other answer was mostly wrong – new answer. in your params hash, :filename is not associated with another hash, it is associated with an ActiveDispatch::Http::UploadedFile object. Your last code line: def screenshot_params params.require(:screenshot).permit(:title, assets_attributes: :filename) is actually correct, however, the filename attribute is not being allowed since it is not one of the permitted … Read more

ArgumentError: A copy of ApplicationController has been removed from the module tree but is still active

For future visitors, I thought I’d provide some clarification on the original problem even though the question is pretty old and there is already an accepted answer. The ArgumentError: A copy of X has been removed from the module tree but is still active is raised when you are trying to access an automatically reloaded … Read more

Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?

run postgres -D /usr/local/var/postgres and you should see something like: FATAL: lock file “postmaster.pid” already exists HINT: Is another postmaster (PID 379) running in data directory “/usr/local/var/postgres”? Then run kill -9 PID in HINT And you should be good to go.

Rails Observer Alternatives for 4.0

Take a look at Concerns Create a folder in your models directory called concerns. Add a module there: module MyConcernModule extend ActiveSupport::Concern included do after_save :do_something end def do_something … end end Next, include that in the models you wish to run the after_save in: class MyModel < ActiveRecord::Base include MyConcernModule end Depending on what … Read more

Rails 4: how do I use Sass Mappings?

As @dinocarl kindly pointed out, the map and list features of SASS are in version 3+. I had to upgrade sass-rails gem to version 5+ because that version of the gem packages SASS 3+. Worked like a charm after I upgraded the gem version (also were few additional dependencies I had to update).

Rails: PG::UndefinedTable: ERROR: relation “…” does not exist

So the issue is happening because CreateOrganizations migration is being run before CreateActioncodes is executed. CreateActioncodes is to be run first thereby ensuring that the action codes table exists. The order in which migrations are run is based on the time stamp of the migration – as indicated in the name of the file. 20141014183645_create_users.rb … Read more

Safe ActiveRecord like query

To ensure that your query string gets properly sanitized, use the array or the hash query syntax to describe your conditions: Foo.where(“bar LIKE ?”, “%#{query}%”) or: Foo.where(“bar LIKE :query”, query: “%#{query}%”) If it is possible that the query might include the % character and you do not want to allow it (this depends on your … Read more

Strange error in rails – missing helper

The problem seems to have been introduced in the latest version of ruby, ruby 2.2.0. Try this experiment: in rails console/or irb: [1] pry(main)>File.expand_path (“./”) => “/users/xxxx/Sites/xxxx” and in the terminal window: ]$ pwd /users/xxxx/sites/xxxx See the different case? If you get that, then deep in the bowels of active support a regex goes south. … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedusedueduedueduseduedueduedu