Advice for Setting Up Rails Sites for Prototyping - ruby-on-rails

I'm learning Ruby on Rails and have just signed up with LunarPages as my webhosting company. To start, I want to write some test applications and get them uploaded and running on my website just to understand how things work. However, I don't want anyone looking at what I'm working on as I learn. Does anyone have any advice as to how I should structure my pages and sites in such a way that I can keep them hidden until I'm ready to go live? Can I easily do something like this?
www.mysite.com <- everyone can see
www.mysite.com/testapplication1 <- no one can see for now
www.mysite.com/testapplication2 <- no one can see for now
Sorry if this sounds like a stupid question. I'm just starting out. By the way, I have heard of Heroku but I've already paid for this webhosting service so I'd like to get my money's worth, at least until my subscription is up.
Thanks!

I'm not sure if LunarPages offers the level of configurability that is required to run rails apps from sub-directories. I'd use subdomains (testapp1.mysite.com, testapp2.mysite.com) and then use appropriate access control (could be htaccess, HTTP BASIC AUTH in your app, or something more complex like authlogic)

Related

Can I use my web server to host my rails application?

I have now build my first Ruby on Rails site and I want to publish/deploy/show it to the world on internet. I have access to space on a web server trough a university that I am associated with. But after some searching I realized that publishing a Rails site is slightly more complicated than publishing a regular html production.
Is there any way to use the space I have? How can I know if the server I have access to is up for the task? Is there any guides on how to do this via SSH or git or whatever? I have search a lot but not found anything useful. It doesn't have to be easy, I just have to work. And it's good if I can learn and understand what I am doing.
I have tried quite extensively to make it work with Heroku (everybody claims it to be so easy) but failed since it will not accept my push. Probably because I use Rails 4.2.2 (I don't want to change this, too many things stopped working when I tried to update) and Paperclip which seems to be known issues.
Please, I'm getting desperate, any help pointing in the right direction is very appreciated.

integrating a discourse message board with an existing rails site

I'm looking at integrating a message board for a site I'm developing in rails. The new discourse board looks interesting http://www.discourse.org/ but there isn't much information about integrating into another site either via oauth2 or sso or perhaps using a rails engine type system. Has anyone succesfully set this up with an app like this?
thx
edit t
Is there a roadmap for how this integration could take place in the future? Parts of it look really intriguing but would like some more info on how this use case could be handled.
edit 2
Since this question is getting a fair amout of traffic, I want to add this post http://meta.discourse.org/t/integrating-discourse-with-current-user-database/6669 which goes over the SSO attempts going on at discourse currently. I have also been in contact with the people at thougtbot about their implementation.
I was interested in the same issue but here's what I found on Github issues:
The easiest way to get it running would be to install Discourse
outside of your app. We do offer the full source code if you want to
integrate with your existing login system, but I imagine it would be a
fair amount of work at this point.
Right now we haven't focused much on production deployments since
we're pre-beta and want to make sure people have a super easy upgrade
system in place to stay on top of security holes.
Not done any app with Discourse, but if their site does not provide a lot of info did you browse the Git Repository https://github.com/discourse/discourse it provides plenty of information and resources links like these ones :
Discourse Developer Install Guide (Vagrant) :
https://github.com/discourse/discourse/blob/master/docs/VAGRANT.md
Developer Advanced :
https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md
Admin quick Start : https://github.com/discourse/discourse/wiki/The-Discourse-Admin-Quick-Start-Guide
Hope it can be of some help for you
Cheers

different domains pointing to the same rails app

I'm creating a rails app where users will be able to create and manage multiple blogs from their accounts. The app will be hosted on www.mydomain.com but i want users to specify a domain they own and be able to point it to any of the blogs they've created so that they can have www.usersite.com point to www.mydomain.com/user/:user_id/blog/:blog_id
that way it looks like is being hosted on their site even though is not
i've been reading some post and maybe CNAME is the way to go for this, but i'm pretty new to creating rails apps and if anyone can help me or point me in the right direction i would appriciate it.
If you need me to clarify anything please let me know
Thanks in advace
danny
As far as I understood your question is more about DNS rather than Rails.
I could suggest you Bandcamp as a live example.
There's some tips:
Using CNAME (and I pretty much sure there's no other options) You should provide every user with his own unique subdomain i.e. user.mydomain.com in your case. Quick googling and we find out that there's a solution for Rails 3 — http://bcardarella.com/post/716951242/custom-subdomains-in-rails-3
You should provide them with step-by-step manual how exactly they can modify their domain DNS entries and add CNAME record. It's up to them. You or Your app can't do it. Again, Bandcamp is a great example — http://bandcamp.com/faq_custom_domains
And then you win.

Share session between phpBB and a rails app

This might be a nonsensical question, but I have this task to create a rails app that shares session information, specifically login/authorization info, with an installation of a phpBB that some other person has customized to be more than just a BB.
Basically I need to rely on the user's phpBB login to authorize access to the rails app. I really don't want to have the user maintain two logins to use this conceptual single app.
I read a lot of documentation on phpBB and didn't find anything like exposed services or an API, but I'm hoping I just missed something obvious.
I've been considering adding a method to expose some hash or something to link the two applications rather than try to squeeze possibly different implementations of session.
Quick context, this work needs to be done fast and cleanly and I've never developed in php and rails is super fast so I am investigating the idea of integrating the two sides.
I might be off in the weeds, so don't be afraid to say so :)
thanks!
Have you checked phpbb-auth?
https://github.com/mattfawcett/phpbb-auth

Does Ruby on Rails affect how a web page looks?

Most of the time, whenever I hit a website that looks "bubbly" in nature, and all prettified in those pastel-like colors, I think to myself, "This was probably done with Rails." And, lo and behold, after some digging into the site's information pages I discover this is actually true. So, I pose the question, not knowing much about Rails but enough about Django to understand how the database stuff works:
Does RoR have any display-specific qualities that affect how a web page looks? Or do all RoR devs naturally use the same Adobe tools to make everything look so ubiquitous?
Ruby on Rails is a server side technology, so it doesn't lend any specific quality to the user visible design. That said, it is a "trendy" technology so people who are likely to write their back-end code with RoR are likely to choose a particular "Web 2.0" style for their views.
As a Ruby on Rails developer, I can tell you that most Ruby on Rails developers are passionate about their work and we pay a lot of attention to details when building websites as much backend as front end. Its not just a trend, its a way of thinking and working.
No, it hasn't any display-specific qualities.
The theory is that RoR makes that backend stuff easier, so more time can, and apparently is, spent on the front end stuff.
Its all done with Mirrors. And CSS. :)
Rails is a very popular Web framework, it's just be coincidence that all the ones you've looked at have been rails apps.
What kind of sites have you been looking at to draw this hypothesis?
that's a funny question with a funny description :) ... bubbly!
As a madman, I develop with RoR, it's kind of rule in our area. We learn madness from the beginning, as a result of http://railsforzombies.org...
May wise men follow a wise path!
Short Answer: NO
However...
As a Rails developer I can say that due to the Agile nature of Rails and the speed in which you can develop web applications with Rails I do find myself having more time freed up on a project to spend polishing the user interface. I believe this may be a reason you often see more polished looking Rails sites.
So in my mind I believe your choice of framework can have a direct correlation to the end product that is produced!
Rails does add some stuff to the front end. Like to every html form, it will add a hidden input element authenticity_token.
You can also tell because rails URLs and form actions will never end with suffixes like .aspx or .php or .html or .jsp, and they won't usually append ?query=book&encoding=utf8 like you see on google. And they won't usually have superlong crufties like you see on amazon (eg http://www.amazon.com/Agile-Web-Development-Rails-Ruby/dp/1934356549/ref=sr_1_1?ie=UTF8&qid=1297922135&sr=8-1). Instead Rails prefers simple routing URLs. If amazon were written in rails, you might instead expect amazon.com/books/Agile-Web-Development-Rails-Ruby
So there are ways to spot a Rails app. I expect other web frameworks, especially the ones that emulate rails, would duplicate some or all of these features, so this isn't a sure-fire method, but it helps.

Resources