rails 4 - what wysiwyg offers image uploading based on user groups? - ruby-on-rails

Not sure the title explains what i'm trying to do or not. Basically, i am building a wiki-like ruby on rails application. I have model called Page that needs a WYSIWYG for the content data. My application has many users that will be grouped by an Organization so each user will belong_to an Organization. My only requirements are 1) it is a WYSIWYG that allows S3 image uploading and 2) When you click "upload image" you should be able to see all the images that have been uploaded by users that belong to the same organization as you. I will need to store the images in a bucket in S3 like <bucket_name>/<organization_id>/rest_of_image_path.... Hopefully this all makes sense.
Does anyone know of a wysiwyg editor that will do this? If someone could point me in the right direction i'd be greatly appreciative! Also, if this is not the appropriate place for this question to be please let me know and i'll move it. Thanks!

Related

Rails - Dynamic vs static application for an e-learning platform

I am about to start developing an e-learning platform where users will be able to watch educational videos for school curriculums and take quizes and so on. The part im not sure about is how exactly should i go about creating each course on the website. Should I create it as a static page where all the content is added manually through code for each course and each video, or should i make it as a CMS whereby each video for each course is uploaded through an upload form and then displayed (using paperclip for example)? Can someone explain to me which is the best approach and why? Baring in mind that video uploading will not be on the user's part, only I will be uploading and adding content to the website.
You should go the CMS way, because it will make your life easier. By generating a lot of static pages, you will see that there are things you want to reuse at another point and then you have to code them another time. With a CMS you can predefine objects like a survey or video content, so that the admin or course leader can use these things in a more efficient way. Mostly, admins aren't techies, so they would be thankful for such a CMS.
This is also important for the following development. Let me give you an example:
You created hundrets of surveys, but then somebody discovers a bug. You need to change your code in too much places. While generating only one model of a survey means also only one fix.

Using cloud storage for images in a Ruby on Rails app

I have been struggling with an efficient way to store and manage the pictures I need in a Ruby on Rails app I am building. I will use a real estate app as an example:
In my real estate app I have a House model and a House controller. On the House #show page I want to list information on the house as well as display pictures for that particular house. Some of the houses have five pictures, others have one. What is the best way to store these pictures and display the ones that pertain to that particular house?
Obviously I do not want to store them with the app, that would be way too bulky. I have tried using Amazon S3 buckets and the Amazon SDK but was unable to get it up and running. Amazon's documentation is all over the place. I currently have pictures stored in a Google Cloud Storage Bucket. They have a public link so an individual image is easy to display. The problem lies in the fact that each house might have a different number of pictures associated with it.
Google's documentation is difficult to navigate, especially when it comes to Ruby. If there were an easy way to access my bucket and filter the files stored there, this would be a breeze. Any ideas? Does anyone know how to do this in Ruby? This type of photo storage is very common and I am surprised at the difficulty I've had in getting it set up. Thanks for your help.
Amazon S3 is one of the best options out there, but it can be a little confusing. Try the paperclip gem for adding file associations to your models.
It gives you multiple options for how to store files and makes it easy.

Best approach to Users Profile Images in Rails App

I am new to Rails and have been diving into many tutorials and online material. I am now beginning to plan/develop my own app. From all the reading I have done I am yet to come across an industry standard way of handling user profile pictures. I have bullet point what I intend to do (below) and would like some suggestions whether this is a good approach and on the right track or whether there is a much better/secure/standard way:
add a 'ProfilePhotoPath' column to my User Model/Table of type String, which will hold the location path/name of the photo
on sign-up form implement an image upload functionality to upload profile pic and store at specified location (reference in step 1 above)
note: I have come across the 'paperclip gem' and 'imagemagick', is this a better easier approach to what I want to achieve?
There are two better ways to upload profile image using Carrierwave or Paperclip.
If you want to use Carrierwave then refer this tutorial Image Upload using Carrierwave
And if you want to go for Paperclip, then refer this links Upload image using Paperclip video tutorial
Another link with steps is Upload profile image using Paperclip
Most people use Paperclip or a more robust solution would be Carrierwave.
Both are really good. I would tell you to learn Paperclip first.
It's fairly easy if you're just starting out.
Edit: checkout this link. Click the green 'run' button to see the app.
http://runnable.com/UnnhcBiQoFhwAAEb/how-to-upload-files-using-paperclip-for-ruby-on-rails

Let end users edit a pdf in rails?

I'm trying to find a way to let the client of a website I'm working on (specifically an administrator) edit the content of a pdf file. For example, if the client decides that they want to change the wording on a pdf (but not the format), they can click a button or something and make the changes they need to without asking me to do it. Any help would be much appreciated. :)
Check out The Ruby Toolbox page for report generation, specifically PDF_generation. There's a couple of different options with reviews and documentation.
https://www.ruby-toolbox.com/categories/pdf_generation

User photos album in Ruby on Rails

I am building an app where user can upload pictures. For now only one picture at a time will do. I have searched around the Web and here at Stack Overflow, but don't really seem to find what I am looking for or at least I don't know what I am looking for if it exists here at the site.
I have tried implementing paperclip and allow users to upload pictures through that and not deleting the old picture when uploading a new one. But I don't really know where to go from here to display all the pictures that a user has uploaded. How do I do this the best way? Should I continue using paperclip or is there an even more suitable gem for my needs?
I prefer carrierwave, over Paperclip, because it has more options and easy to setup. However without knowing what is your ultimate goal for your photo app, it's a little hard to tell what to do next.
If you have a roadmap or feature list, that would be helpful for us to help you with your next move.
But, if it is a simple photo app, might as well try to build it on top of an existing CMS like Refinery; you could easily build a plugin to upload images with Refinery.

Resources