29 Nov '13, 10pm

@yreynhout here's a naive example of a single rails controller action being responsible for both page and resource:

class ClientsController < ApplicationController # This action uses query string parameters because it gets run # by an HTTP GET request, but this does not make any difference # to the way in which the parameters are accessed. The URL for # this action would look like this in order to list activated # clients: /clients?status=activated def index if params[:status] == "activated" @clients = Client.activated else @clients = Client.inactivated end end # This action uses POST parameters. They are most likely coming # from an HTML form which the user has submitted. The URL for # this RESTful request will be "/clients", and the data will be # sent as part of the request body. def create @client = Client.new(params[:client]) if @client.save redirect_to @client else # This line overrides the default rendering behavior, which # would have been to render the "create" view. render "ne...

Full article: http://guides.rubyonrails.org/action_controller_overview....

Tweets

#Solar Is Valuable Resource in Climate Action P...

renewableenergyworld.com 29 Nov '13, 5pm

In CA and some eastern US states, and DC, Solar Energy is already recognized as being more beneficial than most other RE s...

@fredguest TIL Rails sessions require cookies. ...

guides.rubyonrails.org 06 Dec '13, 6am

class ClientsController < ApplicationController # This action uses query string parameters because it gets run # by an HTT...

PS4 Controller LEDs Suck (the battery)

PS4 Controller LEDs Suck (the battery)

hackaday.com 29 Nov '13, 9am

The new Playstation 4 Dualshock controllers are super high-tech. They have bright shiny lights on them to prove it. But [x...

Action for Amur Falcons brings hope for an end to hunting in Nagaland

Action for Amur Falcons brings hope for an end ...

birdlife.org 29 Nov '13, 1pm

Last year’s news of the massacre of Amur Falcons in India shocked the world. BirdLife’s Indian Partner BNHS moved immediat...

Solar Is Valuable Resource in Climate Action Plan

Solar Is Valuable Resource in Climate Action Plan

renewableenergyworld.com 26 Nov '13, 9pm

As the UN Climate Conference ended with a whimper last week, the U.S. continues to move forward in its attempts to curtail...

Malaysia 3G Speeds not up to expectation, SKMM ...

malaysianwireless.com 29 Nov '13, 6am

“We did an audit over three months ago and this has come to light. They have been putting up 3G coverage but not capacity ...

#ClimateThanks for @BarackObama's #Climate Acti...

globalchange.gov 29 Nov '13, 9pm

USCGRP’s decades of research to increase our understanding of climate change impacts, better-forecast future climate chang...

Statement by members of the general public on t...

sgpolitics.net 29 Nov '13, 8am

We note that the AGC action against Mr Au is not in keeping with the spirit of Singapore’s position at the 2011 UN Univers...

New, greener ACTION buses are on their way.

action.act.gov.au 27 Nov '13, 5am

New, greener ACTION buses are on their way ACTION is to be the first city bus operator in Australia to place an order for ...

EmuDroid 4: An Android Gaming Controller

hackaday.com 25 Nov '13, 12pm

[Carnivore] over at Droid Build is working on a very awesome Android Gaming Controller called the EmuDroid 4. It’s a work ...

Reading "A Tour of Rails’ jQuery UJS":

robots.thoughtbot.com 16 Nov '13, 7pm

Derek Prior November 09, 2013 rails javascript If you have a look at the default application.js file generated by Rails, y...