class MessageRoutesController < ApplicationController # GET /message_routes # GET /message_routes.json def index @applications = Application.order(:name) #@message_routes = MessageRoute.all respond_to do |format| format.html # index.html.erb format.json { render json: @message_routes } end end # GET /message_routes/1 # GET /message_routes/1.json def show @message_route = MessageRoute.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @message_route } end end # GET /message_routes/new # GET /message_routes/new.json def new @message_route = MessageRoute.new respond_to do |format| format.html # new.html.erb format.json { render json: @message_route } end end # GET /message_routes/1/edit def edit @message_route = MessageRoute.find(params[:id]) end # POST /message_routes # POST /message_routes.json def create @message_route = MessageRoute.new(params[:message_route]) respond_to do |format| if @message_route.save format.html { redirect_to @message_route, notice: 'Message route was successfully created.' } format.json { render json: @message_route, status: :created, location: @message_route } else format.html { render action: "new" } format.json { render json: @message_route.errors, status: :unprocessable_entity } end end end # PUT /message_routes/1 # PUT /message_routes/1.json def update @message_route = MessageRoute.find(params[:id]) respond_to do |format| if @message_route.update_attributes(params[:message_route]) format.html { redirect_to @message_route, notice: 'Message route was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @message_route.errors, status: :unprocessable_entity } end end end # DELETE /message_routes/1 # DELETE /message_routes/1.json def destroy @message_route = MessageRoute.find(params[:id]) @message_route.destroy respond_to do |format| format.html { redirect_to message_routes_url } format.json { head :no_content } end end end