Homework: What to submit as part of a Rails project - ruby-on-rails-3

I have a very simple Ruby on Rails project that has an ActiveRecords model with some validations, and a pretty basic view and controller that allows basic add/update/delete/search interaction with database.
I'd like for the professor to be able to use the website, assuming he has Rails3 installed.
What would be a good way to submit this project? Specifically: what files and folders should I include, and what files should I exclude? What about directions for the professor? Anything else that I should include?

I think that a good idea will be to develop your project locally and then uploaded to a github repository for the professor to see your code. If you want a free, easy and EXCELLENT place to host your application try heroku, it is a cloud application platform where you can host your project(if you use a shared database < 5MB you will be able to do it with the free plan). I recommend you to include a README file a the root of your app where you add all your directions.

Related

Syncing Route 53 static website to github website repository (allowing offline/destop editing)

I have had a github.io website for quite some time, and want to move it over to it's own domain name. Currently, I have transferred all the files to the right S3 bucket and I can access the website all the same as I can my Github. However, I want to be able to edit individual files in a desktop app (such as SubEthaEdit or Brackets), like you can in Github, which to my knowledge you cant.
I would like to be able to migrate the Github website over to the domain name, so that when I edit, save, and push a commit from the Github desktop using SubEthaEdit, it would be automatically updated on the domain website (ideally). Either this, or they share a library that is still accessible from the Github desktop app. I really just hate editing files using S3's editor, or having to download and re-upload any document I am working on.
Im quite new to any sort of coding or programming languages other than a little bit of javascript, apologies if the language I used is, shall I say, sub-par.
Got It!
#ceejayoz helped to point me in the right direction.
after some fiddling, I got a CNAME record that points towards my github website, while maintaining https.

Alfresco webscripts File upload directly to alfresco repository

I've been going through CMIS model in general and how to use Alfresco as CMIS repository in Alfresco Wiki and Documentation(I installed 4.2d on Windows). I am confused about many things but here is what I need to know right now:
Is there any portlet webscript i.e something I can call from my application that opens like a popup or something close available that Alfresco provides to upload files directly to Alfresco repository. If not could anyone point me to the resources from which I could build one. I would like to access repository in CMIS way preferably. There is something in alfresco/services/cmissamples/upload. Can I use that?
I saw that each of the rest URIs can be appended with alf_ticket. But the thing is URIs work even without alf_ticket. How can I make it mandatory and how can I make folders of that user only to be available for browsing or uploading files.
Any links or examples of using Alfresco as only back end repository with own ui of the application will be helpful.
I found that many of the paths in docs/wiki are incorrect.
check this two links. It should give you good pointers on CMIS and webscripts-
http://22ecmoncloud111.blogspot.com/
http://sumantapakira.wordpress.com/
Alfresco provides file upload API to upload file. Please check following link which provides example and more details for the same.
http://basanagowdapatil.blogspot.in/2011/10/how-to-upload-file-to-alfresco-share.html
http://blog.mwrobel.eu/uploading-big-file-alfresco-web-services/

How to store images on other server

We have a CMS application written in Ruby On Rails 3 and it is using Paperclip to handle file uploads and ImageMagick to do image manipulating. It has been working great, and we are very happy.
For a new customer we want to make a deployment: the application server is in a public network and the uploaded content + the database is stored on a secured computer in their internal environment.
We have 2 main tracks right now:
Make 2 applications from the application we have right now:
A media asset application (to be developed by us) to handle all of the uploaded files using a REST-based API. Images will represented by a GUID, and we would add functions so that the images can be scaled and cropped.
Another application to be most of the application server excluding the image scaling part and storing part. When an uploaded image is requested, it will function as an adapter to the media asset application to get all the files in the correct sizes and layouts.
Pros:
We have control over what's happening
Might be a cool application in itself
Cons:
A project that might grow and be very complex
Need to make a huge change in our current application
Need to run several Rails applications locally while developing
Make an OpenStack installation:
The other option is to make an OpenStack installation and configure Paperclip to use it. If we have understood correctly, Amazon S3 is using something similar to OpenStack and Paperclip should be possible to configure against a custom installation.
Pros:
Paperclip and our setup will not be affected that much
Cons:
Will not be simple to run a local installation
Might be difficult to setup OpenStack
Very little knowledge on the product if it would fail
Any ideas, thoughts, experiences?

How to recognize programmatically that application is installed vs development mode?

I'm trying to get information about license info of my app and MSDN docs (http://msdn.microsoft.com/en-us/library/windows/apps/hh694065.aspx) advice to use Windows.ApplicationModel.Store.CurrentAppSimulator class for that purposes during development/testing and when submitting app to store replace that class with Windows.ApplicationModel.Store.CurrentApp.
I wonder if there is any way to check in code (javascript in my case) if app is already installed from store so my code should use proper class and I won't have to remember every time I submit update of app to store to replacing those classes properly.
As far as I know, I could not find such thing. In fact, LicenseInfo is what provides information about the store listing.
I use a config.js file to keep settings at place which change between development and production. For example - if your app talks to a service, service URL also will likely change between development and production; the service might be running at localhost for development and for production in azure environment. I keep a bool in here and change by hand.
I have not automated it fully. but it is likely possible. need to dig through the msbuild logs for the build created for the store. if there is configuration setting found, then project can have two config.dev.js and config.release.js and msbuild need to conditionally pick the right file. I haven't looked into this yet.
I think I found at solution as described here WinJS are there #DEBUG or #RELEASE directives? . Not ideal, but works for me.

Pull/Display a list of MHTML files in the Public folder and embed them as IFrames in my Rails application views

I have a client that uses SQL Server Reporting Services to generate reports and exports them in MHTML. The Client wants to just push the MHTML in a pre-defined directory structure to my Rails public/reports folder.
Is there any way in Rails to "Take in" the directory structure, create a list of files recursively, generate an unordered list and then create routes dynamically for each MHTML file? I know MHTML files can be embedded with Iframes (although with limited browser support, this is not an issue for me)
The predefined Directory structure is Public/Reports/Dashboard/Exceptions/
Dashboard will contain 1 MHTML file and exceptions (which will be a sort of subnav or child of Dashboard) will contain an undefined amount.
The layout template will be a sort of wrapper.
Anyone who has experience with Rails know the best way of achieving the desired result?
Any help will be sincerely appreciated. I am using Rails 3.0.20 (which doesn't have the Asset pipeline), this will won't be hosted on Heroku (I am aware of no-write permissions)
(Sorry, I'm not super familiar with MHTML files, so I'm going to assume these are just static files that a browser can interpret.)
There is nothing in particular in Rails that provides the behavior that you're referring to. Rails is just a framework to help serve dynamic responses, and the functionality you want is in relation to the filesystem, which Rails mostly abstracts away.
There's a couple options I can think of.
Roll your own
Ruby has file and directory utilities which you could use to read in the contents of a directory in public and render the kind of response you'd like. I would start here:
http://www.ruby-doc.org/core-1.9.3/Dir.html
And play around with ruby's directory globbing to get a file listing.
Use Rack
Rails is built ontop of Rack, a standard webserver interface that most ruby application server implement now. Rack provides some libraries that make serving static assets like a traditional web server a little easier.
Here's a couple of resources to check out:
http://quickleft.com/blog/rack-130-serving-static-files
http://edgeguides.rubyonrails.org/rails_on_rack.html