jekuno / milia

Easy multi-tenanting for Rails5 (or Rails4) + Devise
MIT License
341 stars 72 forks source link

Sample Milia app isn't passing a tenant param? #58

Closed tgmerritt closed 7 years ago

tgmerritt commented 9 years ago

I followed the sample app with Rails 4.2 and Ruby 2.1.5 and when I get to the signup page and submit I see the following stack trace in the error.

There is no tenant param being passed, and it's apparently required. I made sure I didn't miss a step, it's a brand new database with nothing in it, it's a brand new app without any modifications to the step-by-step instructions other than what's mentioned above with Ruby and Rails.

Any advice?

11:24:29 web.1  | Processing by Milia::RegistrationsController#create as HTML
11:24:29 web.1  |   Parameters: {"utf8"=>"✓", "authenticity_token"=>"ReCQQiaS3UchSGJRxf1BjLzi84wjGUoq6VFdIzYWgWmD5NyYFXFtteqMoSLA0/0GNMLwRth3+qLguBv3b50Byw==", "user"=>{"email"=>"tgmerritt@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
11:24:29 web.1  | Completed 400 Bad Request in 2ms (ActiveRecord: 0.0ms)
11:24:29 web.1  |
11:24:29 web.1  | ActionController::ParameterMissing (param is missing or the value is empty: tenant):
jekuno commented 7 years ago

Do you still have any questions regarding this issue? If you solved it feel free to share your insights. If not so please give it a try with the up to date Rails 5 branch https://github.com/jekuno/milia/tree/rails5-support.

jekuno commented 7 years ago

You need to provide a view for organizational signups (which contain form fields for the new tenant). Have a look at an example in the README at https://github.com/jekuno/milia/blob/master/README_DETAILS.md#view-for-organizer-sign-ups.

jekuno commented 7 years ago

Also check the instructions regarding the new sample app: https://github.com/jekuno/milia#sample-app

jekuno commented 7 years ago

Closing it for now. Feel free to add a comment if you still have questions.

t0nylombardi commented 7 years ago

I am having the same issue.

Processing by Milia::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"8e0asnLUyNFAXF6ZLO67h8QVkey054qbJEhyqqZmHvuNUYQpK/gIaHB+cx5DFztD/+puisVDsV0CXsOv3JM7xA==", "user"=>{"email"=>"alombardi.331@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
Completed 400 Bad Request in 18ms (ActiveRecord: 0.0ms)

ActionController::ParameterMissing - param is missing or the value is empty: tenant:

I tried with the rails5-support branch as well ... same issue.

jekuno commented 7 years ago

Could you please have a look at https://github.com/jekuno/milia/issues#issuecomment-318091135 and see whether this helps?

t0nylombardi commented 7 years ago

@jekuno this link doesn't lead to anything

jekuno commented 7 years ago

Ok, here's the correct one: https://github.com/jekuno/milia/issues/76#issuecomment-318091135

emrahyildirim commented 7 years ago

I am having the same issue.

param is missing or the value is empty: tenant

require actionpack (5.1.4) lib/action_controller/metal/strong_parameters.rb return key.map { |k| require(k) } if key.is_a?(Array) value = self[key] if value.present? || value == false value else raise ParameterMissing.new(key) end end

Alias of #require.

alias :required :require

sign_up_params_tenant () usr/local/rvm/gems/ruby-2.4.1/bundler/gems/milia-05b72dd72bfa/app/controllers/registrations_controller.rb

protected def sign_up_params_tenant() params.require(:tenant).permit( ::Milia.whitelist_tenant_params ) end def sign_up_params_user()

This is the solution of the error.

Branch I used

ruby '2.4.1' gem 'rails', '~> 5.1.4' gem 'puma', '~> 3.7' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.2' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.5' gem 'milia', github: 'jekuno/milia', branch: 'issue#76'