Category: ruby

ActiveModel::ForbiddenAttributesError when creating new user 0

ActiveModel::ForbiddenAttributesError when creating new user

ActiveModel::ForbiddenAttributesError when creating new user Solution: On your POST handler, you need to untaint your params with: class UsersController < ApplicationController (...) def create #post @user = User.new(user_params) (...) end (...) private def user_params...

Upgrade routes.rb from Rails 2 to Rails 3 0

Upgrade routes.rb from Rails 2 to Rails 3

,\s:controller\s=>\s['"](.*)['"]\s,\s:action\s=>\s['"](.*)['"] => "$1#$2" map.connect(.*),\s:conditions\s=>\s{\s:method\s=>\s:get\s} => get$1 The official way is with this plugin https://github.com/rails/rails_upgrade But it is outdated, and upon extracting the routing upgrade script, the output is not usable and still requires manual...

undefined method `request_uri' for #<ActionDispatch::Request:0x00000008bc79a8> 0

undefined method `request_uri' for #

undefined method `request_uri' for # Replace : def store_location session[:return_to] = request.request_uri end by : def store_location session[:return_to] = request.url end et voilà !

conftest.c:16:1: error: too few arguments to function 'main' 0

conftest.c:16:1: error: too few arguments to function 'main'

I need help for this !!!! I didn't find the solution. c:\Ruby22-x64\DevKit>gem install mysql Fetching: mysql-2.9.1.gem (100%) Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing...

Json native gem requires installed build tools 1

Json native gem requires installed build tools

Let's fix this : $> gem install activesupport Fetching: i18n-0.7.0.gem (100%) Fetching: json-1.8.3.gem (100%) ERROR: Error installing activesupport: The 'json' native gem requires installed build tools. Please update your PATH to include build tools...