Using remote_function
This wonderful built-in function is a great way to make easy Ajax calls. In this example I will show you how to use remote_function with the onClick call, and also within a JavaScript function.
First, lets make a checkbox called finish; this link will send the id of the item to the database to be updated. [...]
Winn Scriptatype: 1.7
I wanted to re-cap the new adds in 1.7 for rails. The new method calls are as listed:
# Added V1.7b
textlink_do_fade
textlink_do_puff
textlink_do_blindup
textlink_do_dropout
You can build any of the above calls with:
textlink_do_fade(’Link Text’,'divYouWantToUpdate’,{***},{****})
Visit the project for more info on how to use the latest methods and more. Winn Scriptatype project home page. at Ruby On Rails Railway.
WinnScriptatype:Rails v1.7b
I just released WinnScriptatype version 1.7 beta on the RubyForge project page. I have also made some fixes to version 1.5 and it is now production ready. The latest release has added some new functionality and the ability to make calls to display text. The call still supports the effects and Ajax request url along [...]
Rails Plugin: WinnScriptatype
Making an Ajax checkbox just got easy. This very simple plugin was built for my own use. The idea was to make one call for my checkbox, update to the database, and an effect. This plugin is easy to use and install, i dont have it setup in an svn yet so you will need [...]
Magic Multi-Connections
This plug-in is a great one! I have found a few bugs but it did the job just as i needed it to. I am using this plug-in to connect to three databases, where i am selecting, updating, inserting, and deleting. By adding this plug-in i was able to set my databases in the database.yml [...]
visual_effect with a delay
One of the coolest things I ran across in RJS was the delay method. This delay method will do just that and delay a number of seconds. So lets say you need to highlight something that was just added to the page after the user submits it. I would like it to add to the [...]
Highlight your UI with rails
If you find yourself needing to highlight something after your Ajax call comes back and is finished. Why not highlight it? If your making a call with remote_function, link_to_remote or other then add this small line of code on. Problem solved!
[ruby]
:complete => visual_effect(:highlight, ‘theDivId’)
[/ruby]
Just give it the div or element id and it works like [...]
Listing files in a directory with Rails
In a recent application I am building I needed to pull file names and directory names from a local directory. I searched all over the net for this and found nothing. After reviewing a few of rails built in functions I came across Dir.glob(). If you feed this method a path to a directory it [...]
How to download files with a Ruby
For a project that I’m working on, I want to download a set of pictures from flickr once a day. In this way, my Rails app won’t need to access the flickr api – it can just grab the pics out of an images directory.
I figured that it would be an awfully easy task to [...]
Practical security on your application
Developing online applications is a way of life for a lot of programmers! It’s a great feeling working your but off day in and day out, night in and night out, sometimes all night and sometimes with no brakes! Then launch day comes and you are so happy any cant wait for people to start [...]
juneLite launching in Rails
I have been working on a new improved version of juneLite this time it will launch in rails and not PHP with the june framework. I am also making a few changes to the application and how it works. The UI will remain the same but a few changes in features. This move to rails [...]
3 ways to find with Rails
Searching for data in a database is the best and easiest part of a rails app! I have come up with a list below of three ways to get the job done. Use any of the three and you will be very happy with your results!
One of the design principles of Rails is providing a [...]
Ajax and Ruby on Rails
Submit your form via Ajax and save the results to a database. To do so just follow the steps below. First we need to open the form tag (form_remote_tag), then we will send the form to a url, a position and what id to update!
[ruby] “my_list”, :url => { :action => :addtodo, :id => @list [...]
Changing data in RoR
I needed to change some data that was not being submitted by my form. Your asking, what? Well say you have a form for account signups. The form has fields for: full name, email, and password. Now your database has columns for: full name, email, password, signupdate, and status. I needed to send the database [...]
Beginners watch out for the error
When I first started Ruby, I ran into many syntax errors. Nothing big, everyone will do it once in awhile it’s a normal phase of learning code! I seem to hit one error ALL the time; it’s when I am going to validate something. I open my model and start writing and I use Validate [...]


