Category: All

Ruby Select list and ‘selected=”” ‘ syntax 0

Ruby Select list and ‘selected=”” ‘ syntax

Wow, it’s been a long time. Guess I’m a bad blogger! I’ve been absorbed in learning Ruby on Rails and also gained a couple new clients who have kept me very busy. In one of my ‘learning’ RoR projects, I needed a Select list, which was easy enough to accomplish. However I also needed to have a specific option selected based on a database entry. I had such a hard time figuring this out for some reason!! RoR documentation is still slim, unfortunately. It can be difficult to find answers to specific issues. However, one would think it would be...

Add Ruby on Rails comment (#) to Dreamweaver coding toolbar 0

Add Ruby on Rails comment (#) to Dreamweaver coding toolbar

Ha! I figured it out. To add the comment type you apparently have to edit not only the main configuration files, but also the local user configuration files (under C:\Documents and Settings\Sara\Application Data\Macromedia\Dreamweaver 8\Configuration). To make a long story short, in order to add the # comment type to Dreamweaver 8 context menu and coding toolbar, I made the following changes: In C:\Program Files\Macromedia\Dreamweaver 8\Configuration\Menus\menus.xml, add the following lines: 918: menuitem id=”DWContext_HTML_Selection_ApplyRubyComment” name=”Apply # Comment” enabled=”dw.getFocus(true) == ‘textView’ || dw.getFocus(true) == ‘html'” command=”dw.getDocumentDOM().source.applyComment(‘# ‘, ”)” domRequired=”false” 924: menuitem id=”DWContext_HTML_Selection_removeRubyComment” name=”Remove # Comment” enabled=”dw.getFocus(true) == ‘textView’ || dw.getFocus(true) == ‘html'” command=”dw.getDocumentDOM().source.removeComment(‘#...

Apply Ruby on Rails comment in Dreamweaver 0

Apply Ruby on Rails comment in Dreamweaver

So, lately I have been teaching myself Ruby on Rails, using the Sitepoint book, “Build Your Own Ruby on Rails Web Applications” by Patrick Lenz. In the process I have been checking out various development tools to work with Rails. The first tool I tried was Aptana’s RadRails. RadRails has a lot of functionality, gets great reviews, and seems really cool, however… I couldn’t get it to work properly with my existing RoR project. When I import my project, and start the server, I cannot run the project in my browser. It works fine if I use the command line...

PHP call to MySQL db: Select Count(*) 0

PHP call to MySQL db: Select Count(*)

Trying to pull a list from a database, and at the top of the list I wanted to display the count of the rows found. My original code involved 2 queries to the db, one to select the rows and the next using select count(*) to count them. My code looked something like this: <?php $query = “SELECT * from songs ORDER BY title ASC;”; $result = mysql_query($query) or die(“<p align=’center’ class=’error’>Sorry, query could not be executed<br>”.mysql_error().”</p>”); $row = mysql_fetch_row($result); $html = “$count_rows Songs Found.<br><br>”; while ($row=mysql_fetch_array($result)) { extract($row); $html .= “$title – $artist<br>”; } $query = “SELECT COUNT(*) from...

Change order of posts in WordPress 0

Change order of posts in WordPress

Today I needed to change the order of posts in a WordPress blog, from the default (desc by date) to asc by date. To accomplish this, one needs to open the file wp-includes/query.php. Line 1116 must be changed from: $q[‘order’] = ‘DESC’; to: $q[‘order’] = ‘ASC’; That should do it.

Small triumph today… 1

Small triumph today…

I had an issue with the navigation I’m building into another demo site, this one for a city government office. (BTW, I have finished 2 other WordPress demo sites… see previous post.) I am using CSS to style the nav menu and create button-like rollover effects. They work much faster than the JavaScript kind, and besides I don’t like JS so it was important to me to get this working on this site. To build the nav I used a method called Suckerfish Dropdowns, as described on A List Apart. I have had this method running on another live client...

In WordPress hell 1

In WordPress hell

OK, this day has been a nightmare. Trying to customize a WordPress template is not as easy as they make it sound in the tutorials, and I’m not a CSS novice either (or HTML, or PHP for that matter). It started out all right — I created my little header and footer files, and got them all working. The real fun began when I tried customizing the sidebar and positioning elements to make the pages look consistently the way I want (yes, pages not posts, since hopefully I’m going to be using WordPress as CMS for whole websites). The part...

WordPress as CMS 0

WordPress as CMS

WordPress is totally new software to me, and though it is usually associated with blogs, I stumbled upon a surprising “off-label” use for it the other night while checking out a competitor’s website. I originally was looking at the site because many months ago, this client had hinted around that they might need a new website. To make a long story short, we missed out on the opportunity and I went on their site just to check out what they had ended up doing with it. It was while looking at the design that I noticed all the links had...

Yet another lesson about assuming things 0

Yet another lesson about assuming things

So last night I was putting together a simple contact form (I know I keep saying “simple” a lot, but I’ve been out of the Flash loop for a while, so I’m just taking it easy! 🙂 ). All I’m doing is making a contact form that will take customer input and send variables via GET to a PHP page. The PHP page then sends us the info using email. Very easy. It was all straightforward, until I started adding radio button groups, which I have to admit I don’t think I’ve done before, at least not in Flash. I...

Flash navigation and creating buttons 0

Flash navigation and creating buttons

This post is about some recent issues I had creating simple Flash navigation. I chose to use Flash because though it is possible to create a nav menu entirely in CSS, it takes up way too much time to try and get it to behave the same way across browsers. Fortunately Flash is ideal in this situation. OK, two things. They may seem ridiculously easy, but I know that sometime in the future I’ll probably have the same sort of issues and it will help to have them noted here. The first happened last night when I decided to use...