Form Building UI for Rails? - ruby-on-rails

I am developing my first Rails app, a web replacement to a paper form system. Some way through development I discover my client wants to be able to add ad hoc new forms to the live system.
I have considered using wufoo/ google forms/ or survey monkey, but I don't think they are going to fit the bill, due to integration requirements.
What I basically want is to enable one or two super-users to create forms, which will then be available to other users in the system. When the forms are completed the output should be made available to my system. The data is to be manually collated for analysis, so even CSV is fine - there is no need for complex modelling.
I have been struggling to find any paths to a solution - I really don't want to build a form builder myself! So if anybody can point me in the right direction it would be most appreciated!
Cheers!

The liquid template is a good choice for custom building web pages. The easier approach is creating pure HTML pages with form to your system, if your customer allows to.
For the data storage, you'd better try nosql database, such as the mongodb and mongo gem as the ruby adapter, so you can save any data structure without managing the tables and columns. By the way, you have to learn some ruby meta-programming skills to process the dynamic data from the client.

Related

Separating out user management and Stripe payments into a second app and linking via API. My Neo4j knowledgebase

I've built a database in Neo4j and use Rails with Neo4jrb as an easy way to manipulate the database. For reasons I explain below, below I call this a knowledgebase (kb) instead of database.
I starting working with a friend who wants to provide access to the kb for users of his app. So I built an API in rails so he can access it.
Now my friend and I are talking about building a membership site with subscription payments. So I figured I needed to figure out how to build Stripe subscription payments into my app. I found this great tutorial by RailsApps which in terms of functionality does exactly what I need, it relies on a gem called Payola which makes Stripe integration easy. Payola is great but it works with ActiveRecord, not Neo4j. I was thinking I'd have to figure out how to do what Payola does with Neo4j.
But now I have the idea of just building a separate app using the RailsApp+Payola approach, and then just hooking that app up to my kb's API.
The reason I say knowledgebase is because its purpose is to structure knowledge within a particular domain. I use the graph database Neo4j because the graph-based data model suits this goal, for example (object of type A) -[has a certain influence on]-> (object of type B).
So I like my idea of using a separate app for managing users and subscriptions because then I avoid mixing app specific data with domain knowledge in the database.
So I guess my concern is, what might I be missing? Will speed be a concern if this membership site has to access an API every time a page loads? Would there be unusual security concerns?
It's perfectly fine to use another database next to neo4j. You should always use the database that fits your needs I think :)

Rails application architecture and common setup

So I am starting out on company project that will have several components:
At first...
Job list
Client profile creation and management
User administration and access (login, signup, roles, etc)
later...
Messaging
Schedule
Basic reporting
way later...
Deeper analysis and bi
I'm wondering if it makes sense for each bullet item to be its own rails project, self contained and modular (if that is indeed the case); or if it's just best for it to be in the same app. I could envision a situation where each module could operate so independently of each other that it wouldn't need the rest (except for the user funcionality) and another situation where all modules would be used together.
It seems like to me that many tasks can be handled with a lighter framework like Sinatra (and then situated physically under the rails app). It also seems like it would be a lot of overhead to have several rails apps running on a server. But I am not totally aware of all the pluses and minuses to operating each scenario.
I know this is kind of a general question that is bound to get a lot of "it depends" kind of responses (and rightfully so) I was looking for opinions/examples of how you setup this kind/your kind of project in rails. I am a quasi noob so be gentle.
Thanks in advance!
Generally speaking I would consider a website to be a suitable target for a Rails app. Each part of the app can have its own namespaces within the app, so the app has some structure internally, but they should all be one application. Consider things like sessions, where you want a user to login and use whatever features of the site you want. You want those sessions in one application without a user having to login to different sections.
Saying that, if there is complex or extended functionality that isn't part of the MVC architecture (say talking to an external API, data-mining etc), then you could offset that to a separate project and a include it as a Gem in your application. You would still have one main Rails application that includes those Gems.
You might also want to bundle together a section of your project into a reusable Rails engine that can be loaded into multiple projects. For example, Devise handles user login and management. It is a Rails engine, bundled as a Gem, that you include in your project.
Another example from Meducation (one of my sites). I'm in the process of extracting our email tracking system out into its own Rails engine as I feel its functionality sits alongside Meducation and is not a core part of it. I can then use it in other projects as well.
In your specific example, I think your requirements fit fine in one Rails application.

Web-based database/forms RAD tool

I'm searching for something of which I don't really know the name of.
From time to time, I have to develop a small tool for a small group of users which is basically a web frontend to one or two database tables. It's very basic and something which one could do in a spreadsheet (without the problem that only one user can have the file open at a time and something like Sharepoint is not available) or for what one would have chosen MS Access in the 90s. Google Docs would also be possible, but we'd like to keep our data in-house. (I for myself just use phpMyAdmin for that, but it's not suitable for not tech-savvy end-users.)
So I'm looking for a tool which generates/provides a forms-based Web interface for simple models or database schemes that I create. First, is there a common name for such a thing? And second, does anyone have recommendations (preferably open source and/or free)? The closest thing I've come to is the scaffold generator in Ruby on Rails, but it's very basic and not optimal since it's only designed for generating prototype could which one should edit later, and last time I have looked at it, it was not possible to differently updating your model, i. e. regenerate code for model changes but preserving the manual changes of your code.
Thank you.
You're looking for Web UI Framework. Look into http://agiletoolkit.org/

Tools for someone with low programming experience to create a simple CRUD Web-application?

a friend of mine wants to create a simple inventory database that can be deployed on the web.
He has had a lot of experience with Database tools like Paradox. Moreover he has experience with writing Macros and programs with Basic, and even a bit of C++ experience. He uses Windows and Mac OS X, though mostly Windows.
If the requirement of having a web application wasn't there I would recommend MS Access.
Currently I see these options:
A) Ruby on Rails
Pros:
easy to start out (even on Windows?!)
at least from a programmers point of view perfect to create simple CRUD applications
can be deployed at virtually every popular Cloud hoster
I could easily assist if there were problems
Cons
ActiveRecord is from my point of view too technical
Designing forms requires ability to fiddle around with CSS and HTML
B) VB.Net
Pros
he has experience with simliar programming languages
easy to create forms and possible to deploy CRUD apps on the web
Cons
can be deployed only at few hosters (only Azure?)
simple problems can be quite difficult to solve in VisualBasic
C) Cold Fusion, ...?!
Pros/Cons
I have no idea
I am happy to hear about your suggestions.
Thanks, Philip
I have yet to use it, but the http://www.force.com/ platform (which salesforce.com is built upon I guess) is supposed to make it easy to develop data driven apps for more like business analyst roles. There is a cost to host it, but one app isn't that much on a monthly basis and the 30 day free trial would let you figure out if it worked for you or not.
If you are looking for database application frameworks for people who are not software developers, you might look at LightSwitch. It is designed for that particular demographic.
As much as I like Ruby on Rails AND the .Net platform for database-driven apps, they are both designed for developers to use. Going to something designed for your task might just be what your friend needs.
http://www.microsoft.com/visualstudio/en-us/lightswitch
Check out the examples on agiletoolkit, the php framework with jquery and php form examples. It's php with some jquery but to get a basic application up and running against a database, you dont need to know much php at all.
The five lines are the code shown on the left of the image are all thts needed to create a CRUD based on a database table with both a form and a grid with specified columns. It will open a jquery dialog for ADD and EDIT and uses AJAX to update the form.
It also has built in functionality to add one click sorting on the column headings, pagination so you dont get an endless grid on one page but get << < 1 2 3 .. N > >> style links to page through the results set and a search box to filter the results to a specified subset.
Note the colours are added by CSS and can be removed.
The second negative point for Rails ("Designing forms requires ability to fiddle around with CSS and HTML") could be easily mitigated with the use of a gem that generates forms (like formtastic or simple_form).
Apart from Rails I would suggest Monk which is a lighter-than-rails ruby-based web framework. Its components are loosely held together and there are many skeletons (web app templates) to choose from.
Pros
multiple skeletons to choose from
very light/minimal (a new developer will not get lost in the myriad of files and folders that Rails is)
as easy to deploy as Rails (is rack based)
Cons
does not seem to be as well-maintained as Rails
most Ruby stuff don't play well in Windows (AFAIK)
PS: on the second positive bullet of rails (and ruby) I would like to add Heroku which is a GREAT service for getting-started projects.
Building CRUD Apps using ZK Studio is very easy.
CRUD Apps can be built in 5 to 6 steps. Check it out.
Rails is the most innovative and easy approach to creating crud apps ever.
There are plugins like active_scaffold and hobo that allow you to create CRUD apps without having to write almost any code.

What's the best way to integrate a Django and Rails app sharing the same MySQL datastore?

I'm going to be collaborating with a Python developer on a web
application. I'm going to be building a part of it in Ruby and he is
going to build another part of it using Django. I don't know much about
Django.
My plan for integrating the two parts is to simply map a certain URL
path prefix (say, any request that begins with /services) to the Python
code, while leaving Rails to process other requests.
The Python and Ruby parts of the app will share and make updates to the
same MySQL datastore.
My questions:
What do people think generally of this sort of integration strategy?
Is there a better alternative (short of writing it all in one language)?
What's the best way to share sensitive session data (i.e. a logged in
user's id) across the two parts of the app?
As I see it you can't use Django's auth, you can't use Django's ORM, you can't use Django's admin, you can't use Django's sessions - all you are left with is URL mapping to views and the template system. I'd not use Django, but a simpler Python framework. Time your Python programmer expanded his world...
One possible way that should be pretty clean is to decide which one of the apps is the "main" one and have the other one communicate with it over a well-defined API, rather than directly interacting with the underlying database.
If you're doing it right, you're already building your Rails application with a RESTful API. The Django app could act as a REST client to it.
I'm sure it could work the other way around too (with the rest-client gem, for instance).
That way, things like validations and other core business logic are enforced in one place, rather than two.
A project, product, whatever you call it, needs a leader.
This is the first proof that you don't have one. Someone should decide either you're doing ruby or python. I prefer ruby myself, but I understand those who prefer python.
I think starting a product asking yourself those kind of questions is a BAD start.
If your colleague only knows prototype, and you only know JQuery, are you going to mix the technologies too? Same for DB? And for testing frameworks?
This is a never ending arguing subject. One should decide, IMHO, if you want so;ething good to happen. I work with a lot of teams, as a consultant, Agile teams, very mature teams for some of them, and that's the kind of stuff they avoid at all cost.
Except if one of you is going to work on some specific part of the project, which REALLY needs one or other of the technologies, but still think the other one is best for the rest of the application.
I think, for example, at a batch computing. You have ALL your web app in ror or django, and you have a script, called by CRON or whatever, computing huge amounts of data outside the web app, filling a DB or whatever.
My2Cts.

Resources