I'm trying to figure out the best way to make it possible for external sites to embed parts of my Ruby on Rails app into their website through an iframe. My app allows people to buy tickets to events and we want to allow event organisers to embed the whole ticket buying process into their site.
I've found a couple of answers that have helped with the exact 'how to' https://www.quora.com/How-do-I-create-a-embeddable-widget-in-rails
Allow users to embed my content into their sites (like blogs) -- rails 4
But my question is more about the best way to actually implement this. We already allow ticket buyers to purchase tickets through our site so I don't particularly want to create a new controller(s) as a lot of what happens in the controller will be the same. On the other hand, we may want to do different redirects for embedded users - I know we can do this with variants but I feel slightly like the embedded user flow will be so different it might just be a bit confusing. What is going to be my most maintainable option?
I'm also keen to avoid duplicating views and given that I believe it's best to inline CSS does anyone have any advice on how to handle this. If I were to render the embedded views through some engine that can inline all the CSS (I believe some email gems do this), is this a good idea and if so can anyone recommend any gems?