11.4.11

Simple Search Form in Ruby - SQL error no such column name

So I ran into a problem that took me a ridiculously long time to figure out... In fact I didn't really figure it out myself... It took listening to my tutor read the code back to me, before the penny dropped what the problem was.   For ages I was getting the following error
SQLite3::SQLException: no such column: name: SELECT "events".* FROM "events" WHERE (name LIKE '%f%')

I checked the tutorial we'd been given, I checked all the examples I could find on the web and nothing helped I kept getting the same error.  Despite having this method in the model


def self.search(search_query)
    if search_query
      find(:all, :conditions => ['name LIKE ?', "%#{search_query}%"])
    else
      find(:all)
    end
  end


and this controller talking to it


def index
    @events = Event.search(params[:search_query])

    #respond_to do |format|
      #format.html # index.html.erb
      #format.xml  { render :xml => @events }
    #end
  end

However I really should have read the error message clearer as the clue was in the message.  It kept telling me that there was no such column name. and it was right. there was not such column name, my column was called title.  So I changed that one little word and everything is dandy again. Learnt a very valuable lesson though - Read the error messages carefully.

7.4.11

Validating Vimeo's embed against Strict!

I ran into a problem with the embed code that vimeo gives with their videos.  And although it validates against transitional I really wanted to validated it against strict.... so I came across this great site www.designlessbetter.com which gives a really simple alternative code to use.
Instead of using this ..

<object width="400" height="302">
 <param name="allowfullscreen" value="true" />
 <param name="allowscriptaccess" value="always" />
 <param name="movie" value="uri" />
 <embed src="uri" type="application/x-shockwave-flash"
allowfullscreen="true" allowscriptaccess="always" 
width="400" height="302"></embed>
</object>
You use this
<object width="400" height="302" type="application/x-shockwave-flash" data="uri">
 <param name="allowfullscreen" value="true" />
 <param name="allowscriptaccess" value="always" />
 <param name="movie" value="uri" />
</object>
He gives a really good explanation of the offending tag <embed>, 
breaks it down and comes up with a strict validating alternative.  Very grateful!

4.4.11

Difference between forums and blogs

For this blog project we have to comment and illicit responses - a fairly difficult task even for seasoned hacks.  So I thought I had a great workaround - the project is really about understanding Web 2.0 technologies and to my mind the same technologies are used to create forums as are blogs.  So posting some questions and getting responses on a forum would be a legitimate post : response and therefore fulfull the requirements of this assignment.  Wrong!!! A forum I am  informed is not a blog.  The differences being that a forum is made up of numerous contributors and the blog is just a single blog owner that facilitates comments from others.  But what about Blogs that have multiple authors?  Oh they still have editorial control over the content.  But what about forum that have moderators?  Do they not exercise editorial control over the forum?  Jeremiah Owyang at his blog gives a pretty good description of the differences.

 http://www.web-strategist.com/blog/2008/01/28/understanding-the-difference-between-forums-blogs-and-social-networks/

26.3.11

Destroy - Ruby Blog

I've followed all the instructions from http://guides.rubyonrails.org/getting_started.html and I've a blog set up, that has a form, allows a user to create a post, comment, edit, add tags, has some security to protect who can post,and edit, delete etc.  Only problem is that when I click delete post, I get the expected message "are you sure?" with the option to continue or to cancel.  However when I click cancel it goes ahead and deletes the comment anyway.  So I'm trying to find out how I can fix this. 

13.3.11

Scrum Mindmap

12.3.11

Ruby Rails and our Chapter Two assignment

I've got everything to work..... Rails is up and running, the server seems to be behaving himself, I've created two web pages that link to each other, and on one of the web pages I've embedded some ruby that does some nifty stuff like tell us what time it is now, list all the documents in a directory, do some simple calculations, tell us what time it will be from an hour from now, and it also adds some simple strings to-gether.  So happy days!  But along the way I've strayed a little from the instructions in the book.

11.3.11

Installing Rails..it was all going so well until...

I watched Wesley install a new Rails app and thought, Wow that doesn't look so hard.  I set about setting up my own application and it seemed to be going swimmingly despite a small sqlite3.dll missing glitch.  I soon rectified that by downloading the missing dll and putting it in the bin directory of my Ruby 192 application.

8.3.11

The Team / Person / Require exercise

So far we have learned how to create classes, define methods, create variables that can be used by the methods, and create arrays.  The next thing I think is to get all these bits and pieces to talk to each other.  So we've made a person class that makes people, we've made a team.class that makes teams, but now we need to be able to make the put the people into the teams. So I finally think I've got my head around how this all could work.  I need to be able to pass an object I have created into a method that I have defined.  I was given that nugget a week ago but it sounded like swahili to me.  What a difference a week makes. :)

6.3.11

Installing Ruby Mine & Java SDK


I've run into some problems installing Ruby Mine. I had Netbeans installed but I uninstalled as our tutor has advised using Ruby Mine. So I fired ahead and installed Ruby Mine. I had previously installed Java SDK 6 and all seemed to be working fine.

5.3.11

SQL exercise

I'm uploading the details of how I completed our first SQL exercise.  It makes for some fairly boring reading, but I may have to refer back to it someday and will be glad I made it available here. 

4.3.11

Client Side Project

So if you've read my previous post (Server Side Project) I think you'll agree that this project doesn't look half so terrifying.  Although I'm in danger of eating my words, as we haven't had so much of a sniff at Javascripting yet!  So far we've looked at HTML and CSS, and I've felt confident in my abilities to keep up with the lectures. 

By the way the image is of an Electro Indie Pop Band called CSS (Cansei se der Sexy or Tired of Being Sexy” in Portugese).  They are from Sao Paulo in Brazil and they are F.A.B.

Server Side Project - Create an E-Commerce Web Application


So here it is the first project - As I work in theatre, and my job is to sell tickets, I'm thinking that this might be a good product to base my project on.  I've had a fair bit of experience working with various box office systems as a user, and I'm hoping that real-world experience will help me to imagine realistic requirements without too much difficulty, so I can spend my time grappling with the hard work ; actually implementing a solution.



Baby Steps to learning Ruby

I've taken the plunge and gone back to college.  I'm going to document my progress with my very first steps at learning to program.  The Course is Web Technologies. It conists of Client Side (html, css, javascript), Introduction to Web Technologies (a general overview and some SQL), and Server Side (Ruby, Rails).  Server Side is terrifying, and exciting in equal measure.  Our first project is to build an e-commerce web application using the rails framework. Currently I haven't an iota of how I'd even start to build this project, but I'm confident that over the coming weeks it will become clear, and I'm looking forward to building a whole range of new skills.