Category: Development

  • Compile Views with your MVC project

    Most ASP.NET developers will use Visual Studio to build their projects. The program has evolved quite a bit over the past few years. Including excellent features like Intellisense inside of ASP.NET MVC view files as well as some error detection in these, by default, not compiled elements. However, when ViewBag variables are used or other run-time specific elements, Visual Studio is unable to determine potential errors in these view files. Have no fear though; there is a nice and simple solution to help solve this problem!

    (more…)

  • Using CakePHP to scaffold a new database table

    With each new table you create in your database, you will typically need to create a model, controller, and one or more views to get started. CakePHP contains two solutions to get you started creating these files with minimal effort.

    Scaffolding allows an application to perform the following four scenarios, known as CRUD: Create, Retrieve, Update, and Delete.

    In CakePHP, scaffolding can be done in two different ways. The first way is extremely simple, but doesn’t provide the ability to customize easily. The second way requires a bit of setup time; however, once done, you have full control over customizing any aspect of things.

    (more…)

  • Using CakePHP with the jQuery Sortable Plugin

    It’s time to permanently remove all “manual” sorting from the Internet. You know the one I mean where it has the up and down arrows – or even worse, the text box that accepts a numerical order input. By implementing the jQuery template Sortable Plugin, you will be able to provide a simple, but effective drag-and-drop ordering solution for just about any type of data! I’ve also got a lot of other jQuery tutorial examples for beginners.

    In a recent article, I described the required HTML and Javascript code need to implement the jQuery Sortable Plugin on a gallery of images. If you haven’t already done so, please begin by reading this article because this one will gloss over those features and focus on how to implement this with CakePHP.
    (more…)

  • Git – Squashing multiple commits into one when merging a branch

    When you are using Github, it’s quite common to branch your work while working on a feature. Many times your branch contains a lot of small commits that when you merge it into your main branch you want a single commit message describing the full work in that branch.

    Git offers a handy command called git merge –squash [your-branch]. This is then a followed by a regular git commit and git push.

    (more…)

  • Organizing data with the jQuery Sortable plugin

    Have you ever written some code that lets a user change the display order of something – articles, photos, widgets, etc…? You know the one, either you have the up and down arrows or go old school and let them enter a numerical value. By implementing the jQuery UI Sortable plugin aka sortablejs jquery, you will never have to write such a poor system again!

    The jQuery UI Sortable allows for many different types of data to be sorted. It can be a list of items (horizontal or vertical), a table, a bunch of pictures – the sky truly is the limit. In this example, I will explore creating a photo gallery that allows the user to sort the display order of the photos. If you wish to see some demos, check out the jQuery Sortable plugin demos on their website.
    (more…)