Making my existing RoR controller embeddable - css

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?

Related

Is Drupal appropriate for user-supplied data-centric applications?

I have been creating a custom web application using mainly PHP with some Javascript. I have been curious about rebuilding the site using Drupal. I have only produced a 'minimum viable product' and it is functional but not nearly as professional looking or feature rich as it needs to be with using some tailor made modules.
It may be easier just to look at my site, but I will describe it below as well. http://www.localtolocal.ca
Visuals need improving but that is another discussion all together!
I previously felt that it needs to be a custom application but since I want to incorporate things like articles, video content and forums I was thinking using Drupal may be very helpful. What I have so far is the part that I was thinking needs to be written by myself.
I have mostly seen Drupal used for sites that are blog based, content providers or eCommerce focused. My site's main focus is user-provided data. A user creates an account and will either browse and write reviews, favorite pages etc. OR post data about their business or endeavor. A small business would input their contact info, information about themselves and what they provide and that creates a page to display the information on, like this:
http://localtolocal.ca/display_page.php?page_id=23
They are also able to create custom vouchers, add photos and of course update information they have previously input. I will eventually also have paid subscriptions meaning tiered user structure.
Are there Drupal modules out there that can accomplish this? I assume it would need a considerable amount of customization.
Can Drupal be used to create something as full featured as Yelp or a high profile social media site? Asking in terms of evolutionary potential.
Would that learning curve not even be worth it compared to flushing out my custom application?
You can surely use Drupal to create a user generated content driven site as described. True, the learning curve is steep and it'll take some getting used to, but once you get the hang of it, it'll be worth the effort imho. With Drupal you can develop a user-testable prototype of your application within days which is a really big win.
The site doesn't seem really complex, so main challenge will be defining the personas and testing that they have the correct permissions. In general I would suggest extending the user profile so they can submit information about their business, using the flag module to favorite pages and a separate content type for reviews (which you can publish direct and moderate later or the other way around).

Suggestions for deciding on a WCMS for a hockey website?

I need to make a website for my hockey club. My main purpose for this site is allowing people to sign in and post articles and training schedules in their section. Eg Mens, Womens, Juniors and Masters. I want to have some kind of upload manager that will allow them to choose where they post the info too (eg, Mens, Masters and Homepage).
This is the main functionality I'm looking for at the moment.
The clubs previous website used Joombla which I have hated. I found it to be way to restrictive. Its on a old version of it so there are probably many improvements in the new version but from what I've read it seems like it still has a lot of restrictions in how content is managed. I am open to trying it again tho.
I've used Wordpress before and liked it but that was on a small scale projects and I'm not sure it really fits what I'll be trying to do here, since it mostly deals with blog posts and I'll need to have functionality to upload and display files.
I've had a look around at some other ones like Squarespace and Silverstripe. I'm really liking the simplicity of silverstrip(one thing I hate about Joombla is the clutter on the opening page) and am leaning towards it right now if I can find a nice way to have people post news to multiple pages at once.
If anyone has any suggestions they'd be very welcome. I know html, css, javascript and a bit of php. I'm learning Ruby atm so wouldn't be against using it so I could learn more but it might be a bit much for a sports website.
First off, its nice to see someone that likes hockey too :) You can't use Squarespace, you'll need an Apache server for what you want. You will need some way to store information, so you'll need a MySQL database, probably some advanced knowledge of PHP (I'm assuming you don't know how to connect to databases and do some other functions). Wordpress is too limited, so you can't use that. I have never used Silverstripe personally, but it seems like the best of your options here. You'll probably need some more knowledge of PHP before you attempt to make a members system.

How can I improve working with Drupal?

For about a year and a half I used Codeigniter to build my sites. Then a client begged me to build theirs in Wordpress. I soon found the joy of using a CMS (if Wordpress can be called that). So for about the last 8 months I have been using Wordpress as much as possible to buld my sites - I made the content fit the design.
Well, I began to grow very tired of the limitations of Wordpress - I needed more control and flexibility over my sites. So, I have recently started using Drupal 7 (not 6.x - I really like the admin panel).
After working with Drupal now for a little under two months - I have begun to feel like I'm using Stone Age Tools to build Space Age equipment.
So my question is: does Drupal get any better? Do you really have to use Views to display your content? Asking for help on the forums is just a shake better than asking a wall. I feel like to do anything requires a module. Why? Is one better off sticking to a framework?
"After working with Drupal now for a little under two months - I have begun to feel like I'm using Stone Age Tools to build Space Age equipment."
Well, my intiial reaction is that this is what you're going to feel like you're doing when you're working with Drupal 7, which isn't out of alpha yet. A good number of the folks who maintain modules haven't started upgrading to 7 yet, and that means that you're missing out on one of the great features of Drupal, which is it's wide and deep space of premade modules.
Try 6.
Do you need to use views to display all content? No, not at all. You can go in, create a new module, and write the sql and presentation that you want. Or you can find a module that will display things for you. Or, depending, you might be able to get the effect you want just by adjusting the theme you're using.
(As a side note, using an admin theme really pretties up the Drupal experience. I'm fond of rootcandy, although Rubik is nice too. Problem with Rubik is that it's not on drupal.org.)
The strength of Drupal is that by using modules, you don't have to re-write code that someone else has written - you can instead take that code and modify it (with hooks) to do what you want. This means you don't have to write an authentication/autherization system again - it's there in core. You don't need to write up openid handlers - it's in core. You don't need to write code to integrate with twitter directly - there's a module that contains an api that helps out. You don't have to write an xmlrpc server from scratch - you can use the services module.
You don't need to write a website from scratch. Instead, you can start with Drupal, add most of the functionality you need, and then spend your time making it fit what your client wants.
Firstly, you can install the Admin module to pretty up Drupal 6 admin. You don't have to use 7. 7 is still in alpha, by the way. Garland sucks, but, Garland is just a theme- its not 'the' admin itself. The Drupal admin can take the form of any Drupal theme, which is useful in its own right, depending on the use-case.
In Drupal, you can create content types clicking through the interface in Drupal 6 or 7. As far as I can see in WP3, you have to script it. A few clicks vs scripting, the choice for me is not hard there. The first way is a lot more efficient, and a task you can hand off to a non coder to get done.
You don't HAVE to use Views to display content.
You -can- use Views to make the display of content easier, by telling Drupal to gather data and provide a Page, Block, or Feed to display . This lets you create specific sections of content for areas of the site. Otherwise, you would have to create a node, and hijack its template, run a direct sql query yourself AND write the pager functions just to show something easy like the latest 10 "Press Releases" content type. Then, if someone added a new field to that content type, you have to update all that SQL code and display code. Views makes your life easier in that respect. In minutes you can flesh out site sections and arrange content in a myriad of ways. In Wordpress, this method of arranging content without functionality of Views is/was a modern nightmare and a reason I do not want to use it at all unless its a blog and nothing more.
The Drupal Support Forum is tricky. Not all modules are as active as say, Views or Pathauto (being two of the most popular modules). However, SO is also at your disposal. I answer a lot of Drupal questions here. The trick to the Forum there is you have to ask it in the right spot. True, sometimes you may have to wait a few days to get an answer, then again no one -owes- you an answer for a free product. Thats the nature of open source.
Every developer has their favorite modules to use with Drupal, and more often than not, its the same 20 or so modules. It depends on what you are doing, what you are trying to implement. It's not that 'everything needs a module' its that Drupal is such a vanilla install because Drupal does not want to assume your purpose nor overwhelm with options. The UX is something they are trying to improve anyway, and popular modules are making their way into core.
Well, I began to grow very tired of
the limitations of Wordpress - I
needed more control and flexibility
over my sites. So... I have recently
started using Drupal 7
Why not go back to CI? Drupal certainly has it's strengths, but I don't think Drupal will give you any more "control and flexibility" than Wordpress.
If the standard modules/plugins, themes/templates, from WP, Drupal, or Joomla, fill your needs, then using a CMS can be a lot faster than building a site from scratch. But, if those CMSs do not fill your needs, you could find yourself "fighting the framework" and never really getting what you want.
You're just coming out from WordPress, which has great support and is relatively easy to extend to overcome what you call its limitations, if you know basic PHP, HTML, CSS & JavaScript. Every framework has its own potential/limitations.
As a user of WordPress my humble opinion is that you should have stayed with it.
As of you last question, It depends, to stick with one and only one framework has its advantages and disadvantages, the best of all is that you get to know it very well and eventually learn how to extended it. The bad part is that very often frameworks lose popularity and you are left to you own without an active user community and support.
Regards.
All of the popular CMS products (I'd maybe add Expression Engine to the mix) are great for 80% of what you want to accomplish and a huge pain to handle the other 20%.
That's just the nature of the beast.
On the plus side, it's OS so there's lots of people hacking away at it just like you which opens up the potential for someone else already having invented the wheel.
And with bulky enterprise CM solutions like SharePoint I find that you have to reverse the equation to 20/80 (ugh!).
If you're discouraged with Drupal and prefer to stick with WP, WordPress has many thousands of plugins, including ones that can overcome the limitations you're running into and make WP behave more like a normal CMS.
Just do a Google search for "top Wordpress CMS plugins." There's a lot of articles out there that can recommend ways to get WP to do exactly what you want.

Drupal vs Some Other CMS

I'm going to be moving my website to a CMS in the coming months I'd I need some help on choosing an appropriate CMS. Many of the websites I've seen tend to say "use Drupal, hands down". However, my website truly doesn't have a need for commenting or community features. Its pages will need to be modified occasionally, but not extensively. My website will also consist of many programs, each with their own sub-pages and menus.
There are probably 25 people that will need access to the content on my website and will need the ability to update it.
I do like the idea of being able to tag and categorize the content, and the modular aspect of Drupal but is it really right for my website? If not, which CMS may fit my needs better?
It sounds like Drupal would be an excellent solution to your company's needs. I used to recommend WordPress for smaller, single-blog type sites, but now, even for those, I recommend Drupal because you can start small and scale up as your needs grow. It has a very dedicated community and there is a module for just about any need you may have.
I would agree with Drupal. The thing about Drupal is that you start out very small and add on as you need things. There is a ton of documentation, it is well coded, always being expanded on, good forum support, and free. It's the easiest to install, most problem free, and most maintainable CMS system I've seen so far.
You can turn Drupal commenting off with the press of a button, and if/when you decide to add onto your website, perhaps you want an ad rotator, more extensive user permissions, etc, etc, it is all already developed for you and ready to go.
I am not sure if Wordpress supports multiple users on a site.
The smallest you can go for a CMS is something like 10kCMS or the more popular TinyMCE
If it is something small I will go with WordPress as it is easily themed and extensible. There are a lot of community plugins and support. Their documentation is also fairly simple as they don't have a thousand of functions and stuff you need to remember and understand. With some creativity the basic functionality of WordPress is sufficient to solve almost all problems that might arise in small to mid-size website.
I also like Drupal, but you may consider Umbraco as well. http://umbraco.org/ I'd use Umbraco over Drupal if your team is stronger in .Net than PHP. (Really, I think that's a larger concern - what are your organization's strengths? Play to suit them. You are making a decision that will pave the way for many developers besides yourself, and business decisions of your company.) Both are extendable and open source so you can write your own modules/components to customize. It may be cleaner to import into Drupal tables than Umbraco, since it goes down to xslt files. (EDIT: This looks to be no longer the case in the new version - http://umbracohosting.com/umbraco-4---get-excited/one-cms-any-database) From a front end dev perspective, both offer great control of the final output.
From working on legacy stuff a lot, you may end up hiring interns to do the gruntwork. There's bound to be tons of inline tables and all sorts of un-reusable code in there, it may be easier to scrape the content manually and start w/clean markup for the content portions.

Integrating Several Drupal Sites

Three associates and I want to integrate our individual Drupal websites so that a user can move fairly seamlessly between them. We're all new at Drupal, so our planned approach avoids "doing it the right way" by combining modules and database tables.
Rather, we plan on simply having each site's menu system include links to the other sites, and load the selected site via Iframes so that the overall user experience is more like that of a single, integrated system. We'll adopt a common theme for all sites, and pass the user id through the HTML call (and then process it via normal Drupal code) to avoid the need for more than one logon.
What are the negatives of this simple approach and are they so severe that a more traditional site-integration approach should be used?
To be honest, that sounds like a rather nasty can of worms you're looking at opening there. The mere mention of IFrames has me shuddering!
It seems to me like you'd be better off simply having one Drupal instance, with you and your associates as different content authors on the same site.
If you're looking at having the same theme across the three integrated sites, how will the users know which one they're on? And if the aim is to tightly integrate them, why not have the four of you simply contribute to the same core site?
If I had to make the decission, I would use the drupal multisite feature. You can even use the "single sign on" module to get all your users logged in to all sites. It is a bit of work, but I think it is well worth it.
Once you start throwing things into frames your users/visitors will loose the ability to bookmark the correct page. For example, if they find a page they like and book mark it, they will get 'www.site.com/index.php' rather than 'www.site.com/article/article.php?Id=12345'. When they come back, they'll be getting the default page of where the frame lives at rather than the expected page.
Since all three of your sites are based on the same data scheme, it would probably be better to 'do it right' the first time around rather than hacking something together that in the end will cause more headaches than solutions.
Good luck on your project and hope this helps some.

Resources