Client-Side Validation for Rails 2 - ruby-on-rails

Are there any client-side validation gems similar to client_side_validations (https://github.com/bcardarella/client_side_validations) for Rails 2.x?

I am actually in the process of backporting the current ClientSideValidations gem to Rails 2.x
https://github.com/bcardarella/client_side_validations-rails_2
It's not ready for public consumption yet, but you might want to keep an eye on it. It will inherit from the current gem and add the necessary functionality to Rails 2.x.

Here is a project for client side validations for rails 2, it seems to be the same project that the one you refer but it was left in order to give full functionality to rails 3. There is also an example for rails 2.
I recommend to check a great tutorial using jquery validations with rails.
Hope this helps.

Related

how to create web service Api in rails 4?

can anyone help me how to create a web service API in rails 4. I know how create web service API in ruby 1.8.7 and rails 2.3.5 with action web service gem. When I am trying to use https://github.com/datanoise/actionwebservice gem in rails 4, I am getting deprecated errors.I want to upgrade my web service app. Please help me.
Rails-API looks promising, because it will be part of Rails core in Rails 5.
Rails-API
Rails-API is a subset of a normal Rails application, because API only applications don't require all functionality that a complete Rails application provides. so, it compatible well with old Rails versions. I don't know compatibility exactly, but I'm using it with Rails 3.2.x
There are another proper framework for this purpose, for example, Sinatra, Grape, but If you familiar with Rails, Rails-API will be the best choice.
Actionwebservice is long deprecated, in favour of REST API's. At my previous job we used a fork of actionwebservice in a rails 3 project.
Since there is no maintainer anymore for the actionwebservice gem, that fork never got merged back. If you check the fork history, a lot of people are fixing and partially updating it, but it is scattered all over the place.
Afaik none of the forks were updated to use rails 4. But using a rails 3 fork might just work.
If you really need to build a SOAP API server with Rails, imho your best option is to take a look at Wash-out, but you will have to re-write your API code.

The rails way of doing client side validation (Rails 4 with simple_form)

I am new to Rails and using Rails 4. I have started some forms for creating/editing some models and have added some validation which works fine on the server side.
I assumed that Rails would have something built in to handle client side validation - turns out it doesn't.
I have searched on google and found 'client_side_validation' which is no longer maintained and I don't think works in Rails 4 anyway.
There doesn't seem to be an obvious go to library for Rails client side validation. So what is the 'Rails way' of handling this? Roll your own? Duplicate the logic client side using jQuery? Use html5 validation and fall back to server side when it isn't their? Or is there a library (preferably one that works with simple_form) that I can just install and use?
There is client_side_validations, but is not longer maintained. Probably the best way is using some jQuery plugin like jquery-validation.
Rails 4 + Simple form : To install "Client side validations" with simple_form successfully, you should check for latest versions direct from Github with latest branch.
The released gems don't work with Rails >= 4.0
gem 'client_side_validations', github: 'DavyJonesLocker/client_side_validations'
gem 'client_side_validations-simple_form', github: 'DavyJonesLocker/client_side_validations-simple_form'
Make sure your gem file does not use these versions
client-side Validation 3.2.5
client_side_validations-simple_form 2.1.0
These versions does not support rails 4.2.0
For more detail please check this link,
https://github.com/DavyJonesLocker/client_side_validations-simple_form/issues/41
One way to achieve this is in Rails 4 is to use the client side validation gem: http://rubygems.org/gems/rails4_client_side_validations
This guy here is using it: Client Side Validations and Rails4
Railscasts provides a good tutorial (Rails 3) on it here:
http://railscasts.com/episodes/263-client-side-validations
I was able to use a fork of the original client_side_vlaidations that is very active at the moment. I am using the latest version of simple_form, rails 4.1.8, and this client_side_validations. Simple setup with basic config.

What gem better : jCheck and client_side_validations

I want to compare them: both of gems have advantages and disadvantages.For example in client_side_validations more clear and more Ruby to create custom notifications,BUT I have problems with its installation Can't include js file for client slide validation . It is very big minus for me)
jCheck more beatiful, but I need to use more jQuery to use it.
One more: I can't get where all notifications (jCheck) are stored ?
I want to ask : what gem is better for you ?
Depending upon what version of Rails you are using will determine if you can use ClientSideValidations. I haven't had the free time to complete the Rails 3.2 update. Very sorry.

Any suggestion for a stable and compatible version of Ruby on rails

Ok, there are similar question about this but I'm going a little bit further. I started working with Rails 3.2 but many of the things I wanted to do were not yet compatible. For example I was following the exercises of a book and there were using prototype and effect, things that are deprecated in Rails 3.2, I know I can switch between version, but If you would have to start a serious project and you would like to go through the painless way, which environment would you use?
Rails, Ruby, Prototype or Jquery,coffeescript or js, Sass or css, js.erb or rjs.erb...etc etc...
I know companies that are still using Rails 2.2 because the know exactly the version and their compatibilities.
Prototype isn't deprecated, it just isn't the default js library included in Rails 3.1.
Use the prototype-rails gem if you want to use prototype.
https://github.com/rails/prototype-rails
If your book was using prototype then it's most likely very out of date.
Here's a great tutorial for Rails 3.2:
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2

Rails 3 CMS recommendation

I typically use rails models and typus as my CMS as it gives the most flexibility, plus typus is just brilliant. I'm starting a new rails 3 app, and typus isn't rails3 compatible yet. I'm looking around for a CMS that'll work in rails 3. I still want to be able to write my views in haml (rather than some custom templating lang) and need total customizability.
In googling, I'm not finding much. Does anyone have any knowledge about something that would fit my needs?
Thanks.
Another CMS starting to rise quickly to fill in the gaps for Rails 3 scene is RefineryCMS - Github
http://locomotivecms.com is one of good CMS
as of yesterday Refinery CMS 0.9.8 supports Rails 3! You can read about the transition to Rails 3.
This makes Refinery CMS the first popular CMS to support Rails 3.
Alchemy CMS works in Rails 3.
The next_stable branch supports Rails 3.1.
Ubiquo supports Rails 3.2 in the edge branch.
You should look into Osmek. With Osmek you can write in any language you'd like, since you interact with your content through an API. Its a revolutionizing concept to content management, and the idea of flexibility.
Lots of helpful Refinery CMS info at http://www.refinerycms.com/guides
Here is a list of almost all Rails 3 CMS. http://bitprison.net/rails3-cms-solutions-2011
I develop a Rails 3 Item & Content Managament called Opal, which may be interesting to some. Here's more info:
repo: http://github.com/hulihanapplications/Opal
site: http://www.hulihanapplications.com/projects/opal
demo: http://opal.demos.hulihanapplications.com
login: admin/admin
locomotiveCMS and BrowserCMS both work in Rails 3

Resources