Add Filters to Views Using Named Scopes in Rails

This really helped me deliver a rather lovely solution to filtering records on Bunch Rides.

http://www.idolhands.com/ruby-on-rails/guides-tips-and-tutorials/add-filters-...

and here's what I did: http://rides.bunch.cc/clubs/54

and the helper code:

def table_filter(filters, selected_scope)
  content_tag(:div,
    raw(filters.collect { |filter| 
      content_tag(:a, filter[:label], :href => "?show=#{filter[:scope]}", :class => ('selected' if filter[:scope] == selected_scope)) }),  
    :class => 'table-filter')
end

Posted

Can Nottingham make the most of its own creative class?

I was interviewed recently, along with Toby Reid (@tobyjbreid), by the Business Editor of the Nottingham Post. We both believe Nottingham as all the ingredients to become a creative and tech power house.

http://www.thisisbusiness-eastmidlands.co.uk/nottinghamshire/Nottingham-make-...

Posted

My interview on The Entrepreneur Show

I was lucky enough to be interviewed by @robwilmot on his Entrepreneur Show yesterday. It was a great opportunity to share my views on how Nottingham is going to harness some of the current successes in the creative and technology scene to really cement is position as a leading centre for the UK.

Posted

The Big M Went Bold And Got It So Right

I was at the Big M mobile conference (http://thebigm.mobi/) on Monday and am very glad I was. Chris (@bookmeister) and Mike (@m1ke_ellis) made some bold decisions in putting on this event and they paid off.

Bold Decision #1 - Bath

Tech innovation and Somerset are not necessarily two words I would associate but they absolutely showed the rest of the country what a great scene exists there. Nottingham (where I live and work) could learn a lot. It is a beautiful city that is a joy to visit. In the battle for talent that cities are (or should be) engaged in now, they have served Bath well.

Bold Decision #2 - No WiFi

Didn't miss it, in fact I'm glad it wasn't there. The mobile signal was good enough to get emails if anything urgent cropped up. I would imagine this was one of the reasons why people talked to each other more and probably got more out of the speakers. I go to too many conferences these days where people are too busy, surfing, and interacting with people that aren't there rather than engaging with the speakers.

Bold Decision #3 - Price

£200 for a one day conference seemed reasonably pricey and pitching this right would have been a really hand wringer but it was spot on. It meant everyone who came really wanted to get something out of it and I'm guessing it meant they could afford the calibre of speakers that they attracted.

Bold Decision #4 - Comedy/Rock Club Venue

Forget anonymous hotels or convention facilities, more events like this should be held in this kind of venue. Komedia (http://www.komedia.co.uk/) had all the facilities and looked fantastic. People arrived and there was a palpable buzz as they went through the door into the venue proper. Going to a gig for 'work', brilliant. It was especially entertaining watching as a bunch of geeks spilled out on to streets at the breaks, blinking as they readjusted to a bright and very real world still existing outside.


If they run it next year I will absolutely be going as should you.

Posted

Going International (live'ish)

Thanks to @pcmcreative for live streaming my talk at Nott Tuesday last night.

Posted

Let's Show Graduates What Nottingham Can Offer

I think it's time we showed graduates and under-graduates that Nottingham not only represents a great place to get an education but also a fantastic city in which to build a life and career. We have some great creative and tech companies in the city crying out for talented people to join their successful teams. We need to connect people with these opportunities before they depart for more 'traditional' destinations.

To do this, I'm running a recruitment event for internships, work placements and graduate positions in the creative and tech companies of Nottingham.

Before you run a mile with visions of milk-rounds and corporate presentations I'm going to set it up it in a way that better reflects how we, the new wave of businesses in the city, operate.

While I appreciate that we're all often in 'competition' for the best talent we can get, a collaborative approach will reap for more benefits for us all. Let's level the playing field a little and work together to represent Nottingham to the next generation of talented individuals so they can join us in changing our own particular worlds.

So here's the, current, plan

  1. Contribution to the costs are in proportion to the employers size. I'm looking for a couple of larger organisations to underwrite the event (Esendex will be one) in order that we can get it up and running. Current thinking is: 1-5 employees £75, 6-15 £150, 16-30 £300, 30+ £600.
  2. No presentations, no formal standing up in front of a room full of candidates. Each employer will be represented by a number of existing team members (in proportion to the number of opportunities/size) there to discuss them with the prospects.
  3. Venue will probably be something like Antenna and the costs are to put money behind the bar and some simple catering.
  4. Promotion is through word of mouth, contacts, social media and every other way we all know how. Of course the success of the event will rely on everyone knowing about it.
  5. Participation numbers (both employers and candidates) will controlled and ticketed, using Amiando probably
  6. I'm looking at April as the best time to run it.

Firstly, let me know what you think. What have I missed, what could be improved, what help can you give in promotion? Please use the comments so we can have a discussion.

Secondly if you can offer opportunities to graduates or under-grads then come direct: adam.bird@esendex.com, @adambird

We've started something in Nottingham, let's push it to the next level.

Posted

Mobile Boarding Pass Success

P602

I've tried mobile boarding passes before without success. By the time I've tried to navigate round my phone to get to the appropriate image or web site, getting a piece of paper out has generally been quicker. So it was with a degree of scepticism that I tried out the BA iPhone app with it's board pass option for a flight to Lyon today.

It worked a treat.

The key for me was that it worked well enough for the gate agent who hadn't used it before to let me board without issue.

Why did it work this time and not before? A well designed app with good state management and fast app switching was they key. It meant I wasn't tentatively nursing my phone as I approached each of the check points desperately trying to keep the screen alive while not navigating away from the boarding code.

A long promised revolution in travel documentation may well be upon us.

Posted

Base View Model in ASP.NET MVC

I needed to reference some user context variables from within my site master page that had some logic behind their retrieval.

In this example I need to choose the display language for a user.

  1. Check cookie present indicating user's language preference
  2. if not use HTTP language header
  3. if not use the application default language

The pattern I've ended up using is to implement a base view model from which all my specific view models inherit as follows:

public class BaseViewModel {     
    public string UserLanguage     
    {      
       get      
       {          
           return HttpContext.Current.Request.Cookies["language"] != null        
               ? HttpContext.Current.Request.Cookies["language"].Value           
               : CultureInfo.CurrentCulture.TwoLetterISOLanguageName;     
        }
    } 
}

 

I then use the generic class for the master page

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage<BaseViewModel>" %>

Which then allows me to reference the model in the master page and keep the logic for deciding the language to display centralised.

Not sure I'm wholly happy with the inheritance as it adds a level of dependencies which smells a bit off but in the small application I'm working in it was easy to implement and does what I need.

Filed under  //  dev  
Posted