Projects
Online Photo Gallery, Payment & Order Fulfillment: Ruby on Rails Tutorial
Friday, September 18th, 2009 | Custom Development, Improving Code, Photography, Portfolio, Programming, Projects, Ruby on Rails, Tutorials, Web Development, Websites | 4 Comments
This post is a follow-up to the post on my personal blog, titled “Ruby on Rails Photo Gallery & Shopping Cart with RESTful Authentication” In that article, I merely showed off what I’d done with Ruby on Rails, but I didn’t show anyone how. Well, I’ve gotten some comments from people asking me to show them how to build it.
That’s what this post is for.
So on to the nitty gritty details.
Start with the RESTful Authentication Tutorial:
Follow the README to install, but READ THIS FIRST to fix the ExceptionLogger error Then follow these instructions to fix the OpenID plugin error Make sure you get your recaptcha keys for the config.yml, otherwise failed login attempts will bust your application. Fill out the config & database.yml files accordingly, run your database create & migrate rakes, fire up the server and make sure it looks good. Cool? Let’s move on: Define the objects Let’s begin by pointing out what, exactly, we’ll be building this application around: Galleries of Photos that Customers can order with a private Account provided to them by an Admin who can manage the galleries and review the Orders, which are also available to their respective customers. I will go through how to set up the following models like so:
- Galleries
- has_many :photos
- belongs_to :customer
- title
- acts_as_urlnameable (pretty URLs)
- Photos
- belongs_to :gallery
- paperclip attachment: image
- Customers
- username, password, full name
- Orders
- has_many :line_items
- belongs_to :customer
- Line Items
- belongs_to :order
- quantity, size, price
So let’s build the Galleries first:
Then edit the Gallery model:
That’ll be fine for now. Let’s add the Photos model with paperclip image attached:
Now edit the Photo model as such:
You should read all about the paperclip gem if you need more info on this model. Basically, we’re telling it to allow image attachments to the Photo model. Customers can be the RESTful Authentication Tutorial User model, just need to add a couple things here:
Let’s worry about Orders and Line Items later. We’ll have to add a cart, too. I’ll cover it, but it is all derived from Agile Web Development with Ruby on Rails Third Edition
Run your rake db:migrate and confirm all is well. Delete the Galleries layout file so it uses the application layout.
Let’s go see http://localhost:3000/galleries and play around. Add a gallery and then go to edit it. This is where we’ll add SWFUpload. Follow Jim Neath’s advice for this.
You’ll want a photos controller:
The create method I use is:
I had no luck getting Jim Neath’s session fix working, so I put skip_before_filter :verify_authenticity_token in the Photos Controller. Bad? Yea, probably. I haven’t found a better way yet.
Add this code to app/views/galleries/edit.html.erb:
Which leads you to add the following partial: app/views/photos/_image.html.erb
We’ll worry about the destroy link later, let’s integrate swfupload. Download the latest copy of SWFUpload. Copy flash/swfupload.swf to public/flash (make directory first). Copy swfupload.js & upload.js (in Jim Neath’s demo app) to public/javascripts. Copy Jim Neath’s swfupload.css file to public/stylesheets. Copy Jim Neath’s images/icons folder to public/images.
Add this code to app/views/galleries/edit.html.erb:
Yep, a lot is going on there. Reload your galleries/edit page and see if it’s still working :)
Ok, so this gets you to a functioning online photo gallery. Up next will be adding user accounts, a shopping cart, ordering options, customers & paypal integration. Stay tuned!
For now, please find the source here: http://github.com/joemsak/proofs_package
And for help on your project, visit us at http://www.simplifyadvance.com
My First Real-World Rails Project, Part II
Thursday, November 20th, 2008 | Code, Custom Development, Programming, Projects, Ruby on Rails, Web Development, Websites | 2 Comments
Continuing my series on my first real-world rails project, I’ve made some great advancements.
Using attachment_fu, following Mike Clark’s Tutorial for Uploading / Resizing images in Ruby on Rails, and Rmagick with ImageMagick, I was able to add Categories functionality with featured images.
I also used lightbox and Coda Slider for Admin & Home presentations, respectively.
Enjoy!
Real World Rails Project, Part 1.5
Monday, November 10th, 2008 | Programming, Projects, Ruby on Rails, Web Development, Websites | 1 Comment
This is design iteration 1.5 of my first real world rails project. Read part I here.
In this iteration I added drag and droppable table rows and a pricing table for the pricing page.
Since I haven’t figured out how to update the db with the new sort orders reflected after the drag & drop action, this is not considered iteration 2.
Enjoy:
My First Real-World Rails Project part I
Saturday, November 8th, 2008 | Programming, Projects, Ruby on Rails, Web Development, Websites | 3 Comments
I’ve decided to make a video series of my first real project in Ruby on Rails. My love of programming has been rekindled by this amazing language. It’s very true Rails was developed for the new Web. The conventions and defaults built into the framework are true genius and make any project simple, fun and agile. I can respond to any change in scope at any stage of development and give my customers a competitive advantage.
I can truly value Customer Collaboration over contract negotiation now.
Enjoy:
CFD Smile Goes Live!
Monday, November 12th, 2007 | CSS, Clients, Code, Custom Development, Design, Portfolio, Portfolio - Freelance, Programming, Projects, SEO, Semantic XHTML, Skinning, Web Development, Websites, Work Stuff, XHTML | No Comments
Well, my first side project has finally gone live! After months of hard work, I now unveil www.cfdsmile.com to you. We wanted to bring out the services right up front for best emphasis, and lots of heavy stock photo usage for high impact.
We also worked with a professional web content writer to make the content more effective and search-engine optimized. This, coupled with semantic HTML, CSS, and google web master tools, will help this site rank high in keywords for Texas Dental Services.
So, please visit the site if you get a chance, and enjoy!
City of Southfield voted Best Web Site of 2007 by MEDA
Wednesday, July 25th, 2007 | Design, Praise, Projects, Teamwork, Web Development, Websites, Work Stuff | No Comments
From internal Artemis Email:
Just released, the Michigan Economic Development Association?s (MEDA) 2nd Annual Marketing Materials Competition has announced The City of Southfield web site as ?Best Web Site? for the population below 100,000 residents category.
Page Title SEO
Friday, May 18th, 2007 | Artemis Solutions Group, Programming, Projects, SEO, Teamwork, Usability, Web Development, Websites, Work Stuff, XHTML | 1 Comment
I’ve recently sent out an email at work explaining Page Titles and their importance with SEO. I thought I’d share it on my blog. You may or may not have noticed that my Post titles and page titles come before my blog title in my page titles. I did this specifically because of SEO.
PAGE TITLE: – the text that shows up at the TOP OF THE BROWSER and in GOOGLE / YAHOO / MSN et al SEARCH RESULTS
Why is the page title important? It is what the casual searching web user will see when searching for content / services offered by YOUR CLIENT. So the page titles MUST INCLUDE keywords relevant to the pageâ??s content. The page title should be formatted well and DEFINITELY BE MORE THAN JUST A COPY OF THE PAGE NAME. The client name should be included.
If you donâ??t know how to do a very quick keyword-density page title, then AT THE VERY LEAST, format your page titles like this:
PAGE NAME | CLIENT / WEB SITE NAME
So if your client is Artemis Solutions Group and the page is Web Design
You can AT LEAST type this much:
Web Design | Artemis Solutions Group
But if you want to be keyword-savvy (just do a quick search and read on SEO Page Titles and Keywords for quick reference)
You could format it like this:
Web Design & Development | Lansing, MI | Professional Web site Design | Artemis Solutions Group
Itâ??s worth a LOT to the client for us as developers to think about their web marketing strategy and how their content and custom features affect that strategy. A little bit of Usability goes a long way, and is very easy to do.
Proper page titles take minimal effort, and add superb value to the client.
Kalamazoo Public Library Usability Review
Friday, May 4th, 2007 | Artemis Solutions Group, Design, Projects, Usability, Web Development, Websites, Work Stuff | No Comments
I did a short, very brief usability review for Kalamazoo Public Library today. I thought I’d share it.
Again, it’s very limited and I could have listed more, but I was restricted to so much.
- Web site failed Section 108 Guidelines for Government Web sites:
- http://www.cynthiasays.com/mynewtester/cynthia.exe?rptmode=-1&url1=http%3A%2F%2Fwww.kpl.gov%2Fteen%2FHomeworkHelp.aspx
- Menu navigation only works with Javascript enabled â?? text-based browsers can not navigate
- Images not readable with CSS disabled â?? or no ALT tags
- Events link could be converted to front page list of upcoming events
- Link opens in new window to page that does not follow site theme
- External links open in new window
- This breaks the back button (the most used navigation element by internet users)
- Also, breaks desktop experience for users with Tabbed Browsing, eliminates user choice and control
- Internal links open in new window
- Creates confusing navigation experience for most users
- Branch Libraries section confusing â?? pictures do not help describe the links
City of Southfield Web site is Live!
Thursday, May 3rd, 2007 | Artemis Solutions Group, Clients, Praise, Projects, Web Development, Websites, Work Stuff | 1 Comment
From Artemis Vice President, Bunmi Akinyemiju:
Itâ??s been a long 7 months for everyone who worked on the City of Southfieldâ??s website! We are finally live: www.cityofsouthfield.com. Kudos to the team for great work.
This is surely the largest website we have ever built, and surely the most challenging web project we have ever undertaken!
…
Despite all the challenges and hiccups along the way, this was a very unique opportunity for us in many ways.
….
Again, great work to everyone who contributed to the success of this project. Despite the unanticipated size and volume of work and resources that went into thisâ?¦I strongly believe that the visibility benefits from this project will open up several new doors for us.
Michigan Peace Team Design Part III
Tuesday, May 1st, 2007 | Apple, Design, Macbook Pro, Michigan Peace Team, Photoshop, Projects, Web Development, Websites | No Comments
Here’s design rendition III.
I’m trying the green in place of the blue. I updated the logo with a little modern twist, but I don’t know if I’m completely happy with it yet, just trying stuff out. I noticed a little icon in their favicon or whatever and might try a little twist on that. I also got rid of the rounded boxes and made the right bar more open feeling, and matched the “empowering people” theme down the entire bar for headers.
Got to talk with the client last night and showed them my ideas for doing video and linking to other site’s content, be it print pieces or podcasts or what have you.
Read Back…
Search
Tweetin'
- @duncangela hell yea I've been leveling up so much lately
- http://9gag.com/photo/19438_full.jpg
- RT @neotericdesign: Our friends at 10,000 Blankets are ramping up for Blanket Week this Monday: http://bit.ly/bjyNQa
- Just bought my Friday & Saturday Pitchfork tickets, y'all!
- @Schlosser Schlosser I miss you, are you gonna be here for Pitchfork again?