<commit_before>greenbook
=========

Following treehouse tutorials on how to develop a social networking site with rails 4

## Issue 1
In Chapter 3, Jason talks about `attr_accessible` fields which have been depricated now. So I'll have to add those in one of two ways according to https://github.com/plataformatec/devise:

1. Add a shorthand if only going to be using one devise model as follows:

	```ruby
	
	class ApplicationController < ActionController::Base
		before_filter :configure_permitted_parameters, if: :devise_controller?

		protected

		def configure_permitted_parameters
			devise_parameter_sanitizer.for(:sign_up) << :username
		end
	end
	```

2. Derive a Parameter Sanitizer per model class from Devise::ParameterSanitizer:

	```ruby
		class User::ParameterSanitizer < Devise::ParameterSanitizer
			def sign_in
				default_params.permit(:username, :email)
			end
		end
	```

	and then modify the controller as follows:
	```ruby
		class ApplicationController < ActionController::Base
			protected

			def devise_parameter_sanitizer
				if resource_class == User
					User::ParameterSanitizer.new(User, :user, params)
				else
					super # Use the default one
				end
			end
		end
	```

I'll read more about this later.<commit_msg>simple modification of the readme file<commit_after>greenbook
=========

Following treehouse tutorials on how to develop a social networking site with rails 4

## Issue 1
In Chapter 3, Jason talks about `attr_accessible` fields which have been depricated now. So I'll have to add those in one of two ways according to [devise's github](https://github.com/plataformatec/devise):

1. Add a shorthand if only going to be using one devise model as follows:

	```ruby

	class ApplicationController < ActionController::Base
		before_filter :configure_permitted_parameters, if: :devise_controller?

		protected

		def configure_permitted_parameters
			devise_parameter_sanitizer.for(:sign_up) << :username
		end
	end
	```

2. Derive a Parameter Sanitizer per model class from Devise::ParameterSanitizer:

	```ruby
	class User::ParameterSanitizer < Devise::ParameterSanitizer
		def sign_in
			default_params.permit(:username, :email)
		end
	end
	```

	and then modify the controller as follows:

	```ruby
	class ApplicationController < ActionController::Base
		protected

		def devise_parameter_sanitizer
			if resource_class == User
				User::ParameterSanitizer.new(User, :user, params)
			else
				super # Use the default one
			end
		end
	end
	```

I'll read more about this later.
{'fraction_non_alphanumeric': 0.07570352754657154, 'fraction_numerical': 0.003963535473642489, 'mean_word_length': 4.510917030567685, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5542314', 'n_tokens_mistral': 839, 'n_tokens_neox': 711, 'n_words': 263}