Hi guys,

just a little feedback from a beginner. I've finished my first camping app. Thank you for your help and guidance.

The finished app is about quality management and enables users to fill out forms. Based on those forms different quality parameters are recorded per user and per project. These can be called up in summary reports for desired time frame and user. Along with all the forms for a period the average quality evaluation is also displayed. Reports can only be generated by quality managers.

I've managed to reuse only one html form for creating, viewing and editing. In addition, I've setup the form in such a way, that submitting is possible only when the form was called via »new« or »edit« route and the user has appropriate authorizations.

I have one question regarding the session. I don't actually know how to leverage or use it. According to the reference the session adds states to the app. Can someone explain a bit more?

regards,

seba





On 22. 04. 2014 21:27, Magnus Holm wrote:
On Mon, Apr 21, 2014 at 7:32 PM, Sebastjan Hribar
<sebastjan.hri...@gmail.com> wrote:
Hi,

I've updated the gist with my next version:

https://gist.github.com/sebastjan-hribar/11081389

It works as I wanted but for now I left out the styling.

My question is, is this the correct way of setting up routes?
That looks fine. Although you can even simplify the Index-route like this:

   class Index  # look, no < R '/'
   end

Can someone have a look and point out mistakes I've made. I mean the app
works, but I'd like to know
if (of better yet, how) the routing or anything else can be optimized.
It looks fine to me :-)


Secondly, when I'm done I'll need this to be running in a closed network.
I'd need some advice on deployment. I can run it on a spare machine or a
server even, but how what kind of configuration is required (ports,
databases)...?
If you want to run it on your own machine, I recommend using Phusion
Passenger. Passenger (and other Ruby web server) requires a config.ru
like this:

   $LOAD_PATH << File.expand_path('..')
   require 'review'
   Review.create  # remember to call your #create method here!
   run Review

You can test this config.ru locally using the `rackup` tool:

   $ rackup -p 3301

If this works correctly you should also be able to point Passenger to
the same file and everything should work properly!

You can also deploy using Heroku when you have a working config.ru.

As for configuration, the simplest thing is just checking for an
environment variable in Review.create:

   def Review.create
     case ENV['RACK_ENV']
     when 'production'
       # setup for production
     else
       # setup for development
     end
   end

regards,
seba
_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to