Gustavo P

Joined

1,120 Experience
2 Lessons Completed
1 Question Solved

Activity

Posted in Multitenancy with the Apartment gem Discussion

How in the world do I create the tenant and after creation it redirects the user/account to said subdomain

so if the link would be

https://p66.test:3000/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBEQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--490f8acaee978a2fea812761494b23b55702df37/users-2020-06-10.csv?disposition=attachment

how can I restrict a person from just using that link outside of the website?

I'd paypal $50 for the answer!

So if you copy the link of the rails blob and paste it ( incognito ) it basically downloads the file how is this remedied?

So here is the Scenario of what I am trying to do

I have a view

              = link_to admin_page_path(page), class: "edit-#{page.id}" do
                .subcategory.btn.btn-xs.btn-info{"data-subcategory" => page.id}
                  View Subcategories

Here is my javascript

:javascript
  $('.subcategory').on('click', function(e){
    e.preventDefault();

    row = $(this)
    page_id = $(this).data('subcategory');
    console.log(page_id);

    Rails.ajax({
      url: "/admin/pages/" + page_id,
      type: "get",
      dataType: "json",
      success: function(data) {
          /*render partial with data*/ 
     },
      error: function() {
        console.log('the covids')
      }
    })
  })

Here is the controller

  def show
    @page = Page.find(params[:id])
    @page_subcategories = @page.subcategories
    render json: @page_subcategories
     how can I render a partial with the @page_subcategories json response?
  end

How can I get @page_subcategories into a partial which than appends to the specific table row id

Please !

select_tag('entry[detail_ids]'

fixes it

Im having a problem

I have an Entry which can have many Detail through EntryDetail

https://gist.github.com/staycreativedesign/568f07938591d2a8a844d3857c4aac4a

The EntryDetails arent being saved at all

Is this available somewhere?

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.