The action 'destory' could not be found in controller - ruby-on-rails

I think I'm losing it. I can't figure out why a simple destroy link wont work all of a sudden.
I'm getting this error:
AbstractController::ActionNotFound at /plans/v41w74v2
The action 'destroy' could not be found for PlansController
Plan Controller:
class PlansController < ApplicationController
before_filter :authenticate_user!
def index
#plans = Plan.all
end
def new
#plan = Plan.new
end
def create
#plan = Plan.new(plan_params)
if #plan.save
if #plan.trips.empty?
#possible = #plan.group.trips
render "add_trips"
else
redirect_to plans_path, notice: "Plan successfully created"
end
else
render "new"
end
end
def show
#plan = Plan.find_by_unique_identifier(params[:id])
end
def edit
#plan = Plan.find_by_unique_identifier(params[:id])
#group = #plan.group
#possible = #plan.group.trips
render "add_trips"
end
def update
#plan = Plan.find_by_unique_identifier(params[:id])
if #plan.update_attributes(plan_params)
redirect_to plans_path, notice: "Plan successfully updated!"
else
render "edit"
end
end
def add_trips
#plan = Plan.find_by_unique_identifier(params[:id])
trip.each.update_attributes(plan_id: #plan.id)
redirect_to plans_path, notice: "Trips added to plan"
end
def destory
#plan = Plan.find_by_unique_identifier(params[:id])
#plan.destroy
end
Plan show View:
<%= button_to "Delete", #plan, method: :delete, data: { confirm: "Are you sure you want to delete this plan?"} %>
What am I doing wrong?

Yep. You've got a typo. destory.

Related

Couldn't find Model without an ID from application_controller.rb

I am trying to create a session for a model called Commuter by defining a helper method in application_controller.rb file. As follows.
application_controller.rb
helper_method :current_commuter
def current_commuter
#commuter ||= Commuter.find session[:cid]
end
After verifying the commuter's phone number I am trying to create a
login session.
commuters_controller.rb
def verify
#commuter = Commuter.where(phone_number: params[:phone_number]).first
if (#commuter && #commuter.authenticate_otp(params[:otp],drift:300))
#commuter.auth_active = true
if #commuter.save
#Removed from session after verified it
session[:phone_number] = nil
session[:is_verified] = nil
#signed in commuter after verified it
sign_in(:commuter, #commuter)
flash[:notice] = "Your mobile no is verified."
end
else
flash[:alert] = "You have entered wrong otp.Please check again."
end
puts "#{current_commuter.phone_number}"
redirect_to root_path
end
I put a puts to check if the current_commuter is working or not. It is when I checked on the console. Now when I added few links on a view file as follows:
app/views/bookings/outstation.html.erb
<%if current_commuter.present? %>
<li> <%= link_to "Dashboard", dashboard_commuters_path %> </li>
<li> <%= link_to "Logout", destroy_commuter_session_path, method: :delete%></li>
<%else%>
<li>
<a href="" data-toggle="modal" data-target="#signinmodal">
REGISTER | LOGIN
</a>
</li>
<%end%>
Now I am getting the following error:
ActiveRecord::RecordNotFound in BookingsController#outstation
Couldn't find Commuter without an ID
EDIT
bookings_controller.rb
class BookingsController < ApplicationController
layout 'bookings'
before_action :set_ride_later_request_from_ref_id, only:[
:select_vehicle, :update_vehicle_details,
:contact_details,:complete_booking_request]
before_action :set_ride_later_request_from_uuid_ref, only:[
:request_quotations,:quotations, :confirm_booking,
:confirmation
]
before_action :set_trip_type, only: [:outstation, :local_booking]
def new_booking
#ride_later_request = RideLaterRequest.new
#vahicle = RideLaterRequest.new
end
def create_ride_later_request
#ride_later_request = RideLaterRequest.new(permitted_attributes(RideLaterRequest))
respond_to do |format|
if #ride_later_request.save
format.html {redirect_to bookings_select_vehicle_path(ref_id: #ride_later_request.rlr_ref_code.content)}
else
format.html {render :outstation}
end
end
end
def update_vehicle_details
respond_to do |format|
if #ride_later_request.update(permitted_attributes(RideLaterRequest))
format.html {redirect_to bookings_contact_details_path(ref_id:#ride_later_request.rlr_ref_code.content)}
else
format.html {render :select_vehicle}
end
end
end
def contact_details
end
def complete_booking_request
#operation = nil
if params[:get_otp].nil? && params[:get_quotations].nil?
render json:{error:"Wrongly formed request"}, status: 422
end
if params[:get_otp]
#operation = :get_otp
if #ride_later_request.update(permitted_attributes(RideLaterRequest))
SMSSender.send_otp_message(#ride_later_request.phone_number,#ride_later_request.otp_code)
return
else
render json:{error:#ride_later_request.errors.full_messages[0]}, status: 422
end
elsif params[:get_quotations]
#operation = :get_quotations
if (params[:ride_later_request][:otp].blank? ||
!#ride_later_request.authenticate_otp(params[:ride_later_request][:otp],drift:300))
render json:{error:"OTP is wrong"}, status: 422 and return
else
#ride_later_request.user_verified = true
if !#ride_later_request.save
render json:{error:#ride_later_request.errors.full_messages.first}, status:422 and return
end
if #ride_later_request.status == 'UnderConstruction'
render json:{error:"Some fields are missing. Please try again"}, status:422 and return
end
end
end
end
def request_quotations
request_loc = [#ride_later_request.pickup_lat,#ride_later_request.pickup_lng]
#rfq_agencies = #ride_later_request.rfq_agencies.sort_by{|l|l.distance_to(request_loc)}
#ride_later_quotes = #ride_later_request.ride_later_quotes.to_a
#ride_later_quotes.sort!{|a,b| a.total_payable.to_i <=> b.total_payable.to_i}
end
def quotations
#ride_later_quotes = #ride_later_request.ride_later_quotes.to_a
#ride_later_quotes.sort!{|a,b| a.total_payable.to_i <=> b.total_payable.to_i}
if session[:trip_type] == 'HourlyPackage'
render :local_booking_quotation
else
render :outstation_booking_quotations
end
end
def confirm_booking
if #ride_later_request.status=='Unfulfilled' ||
#ride_later_request.status=='Rejected' ||
#ride_later_request.status=='Ignored'
render json:{error:'Trip request has expired. Start a new booking.'}, status:422 and return
end
if #ride_later_request.status=="Cancelled"
render json:{error:'Trip request has been cancelled. Start a new booking.'}, status:422 and return
end
if #ride_later_request.status!="QuotesReady"
render json:{error:'Trip request is in wrong state. Start a new booking.'}, status:422 and return
end
#quote = #ride_later_request.ride_later_quotes.find(params[:quote_id]) rescue nil
if #quote.blank?
render json:{error:'Quotation not linked to this trip'}, status:422 and return
end
if #quote.status != 'Submitted'
render json:{error: "Quote is in wrong state #{#quote.status}. Start a new booking"}, status:422 and return
end
#quote.status = 'Accepted'
if !#quote.save
render json:{error:#quote.errors.full_messages.first}, status:422 and return
end
RideLaterRequestHandler.commuter_accepts_quote(#quote)
end
def confirmation
#ride = #ride_later_request.ride_later_ride
#quote = #ride.ride_later_quote
end
def set_ride_later_request_from_ref_id
#ref_id = params[:ref_id]
#ride_later_request = RlrRefCode.where(content:#ref_id).first.ride_later_request rescue nil unless #ref_id.blank?
if #ride_later_request.blank?
flash[:alert] = "Something went wrong. Please create new booking request."
redirect_to bookings_new_path
end
end
def set_ride_later_request_from_uuid_ref
#uuid = params[:booking_id]
#ride_later_request = RideLaterRequest.where(uuid_ref:#uuid).first rescue nil if #uuid.present?
if #ride_later_request.blank?
flash[:alert] = "Something went wrong. Please create new booking request."
redirect_to bookings_new_path
end
end
def select_vehicle
#ride_later_request = RlrRefCode.find_by_content(params[:ref_id]).ride_later_request
end
def vehicle_type_ac
if params[:booking_summary_id].present?
#ride_later_request = RideLaterRequest.find(params[:booking_summary_id])
else
#ride_later_request = RlrRefCode.find_by_content(params[:ride_later_request][:ref_id]).ride_later_request
#ride_later_request.update(vehicle_type: params[:ride_later_request][:vehicle_type], number_of_passengers: params[:ride_later_request][:number_of_passengers])
end
end
def vehicle_type
#ride_later_request = RlrRefCode.find_by_content(params[:ref_id]).ride_later_request
end
def outstation
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
def local_booking
#ride_later_request = RideLaterRequest.new(trip_type: params[:trip_type])
end
def bangalore_innova
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
def bangalore_outstation
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
def bangalore_taxi
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
def tt_for_rent
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
def minibus_for_rent
#ride_later_request = RideLaterRequest.new(trip_type: 'Outstation')
end
# def select_vehicle_local
# end
def about_us
end
def terms_conditions
end
def privacy_policy
end
def journey_way
#ride_later_request = RideLaterRequest.create(user_params)
#ride_later_request.save
respond_to do |format|
format.html {render :select_vehicle}
end
end
def outstation_booking_quotations
#ride_later_request = RideLaterRequest.find_by(id: params[:ride_later_request])
#ref_id = params[:ref_id]
end
def select_vehicle_outstation
#ride_later_request = RlrRefCode.find_by_content(params[:ref_id]).ride_later_request
redirect_to outstation_booking_quotations_path(#ride_later_request.rlr_ref_code.content, #ride_later_request )
end
def trip_summary
#ride_later_request = RlrRefCode.find_by_content(params[:ride_later_request][:ref_id]).ride_later_request
#ride_later_request.update(vehicle_type: params[:ride_later_request][:vehicle_type], number_of_passengers: params[:ride_later_request][:number_of_passengers])
puts "Ride LATER REQUEST LOG"
puts #ride_later_request
if #ride_later_request.update(additional_instructions: params[:ride_later_request][:additional_instructions], ac: 'AC')
render :template => 'bookings/booking_summary', :locals => {:ride_later_request => #ride_later_request, :ref_id => #ride_later_request.rlr_ref_code.content, :vehicle_type => params[:ride_later_request][:vehicle_type]}
else
format.html {render :index}
end
end
def user_params
params.require(:ride_later_request).permit(:pickup_area, :pickup_city, :destination_city, :pickup_lng, :pickup_lat)
end
def set_trip_type
session[:trip_type] = params[:trip_type]
end
end
It looks to me like the error's thrown here:
def current_commuter
#commuter ||= Commuter.find session[:cid]
end
Are you calling this as a before_action?
Using find raises an error if a record's not found, so I'd suggest you're either not passing in an id in session[:cid], or what you are passing doesn't match a Commuter in your db.
You can use find_by_id to avoid throwing an error (it returns nil if the record's not found), or work around this to ensure the method's only called where it should be.
Does that help?
Edit: Based on your additional info, this could be coming from any of the finds in the bookings_controller. Same explanation as above though :)

No route matches, missing required keys

I'm currently working on rails 5 project in which I want to add a passenger to a transportation. In the in the passengers controller index action I set transportation to be search by the params id. But it returns nil even though it has been created.
Here are the routes:
user_protest_transportation_passengers GET /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers(.:format) passengers#index
POST /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers(.:format) passengers#create
new_user_protest_transportation_passenger GET /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/new(.:format) passengers#new
edit_user_protest_transportation_passenger GET /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/:id/edit(.:format) passengers#edit
user_protest_transportation_passenger GET /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/:id(.:format) passengers#show
PATCH /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/:id(.:format) passengers#update
PUT /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/:id(.:format) passengers#update
DELETE /users/:user_id/protests/:protest_id/transportations/:transportation_id/passengers/:id(.:format) passengers#destroy
user_protest_transportations GET /users/:user_id/protests/:protest_id/transportations(.:format) transportations#index
POST /users/:user_id/protests/:protest_id/transportations(.:format)
Here is the link:
<div class="card">
<div class="card-block">
<h3 class="card-title">Need A Ride?</h3>
<p class="card-text">Find people near you willing to share a seat who are coming to the event. We are all in this together!.</p>
<%= link_to 'Get A Ride', new_user_protest_transportation_passenger_path(#user, #protest, #transportation), class: "btn btn-primary" %>
</div>
</div>
Here is the passengers controller:
class PassengersController < ApplicationController
def index
#transportation = Transportation.find(params[:transportation_id])
end
def new
end
def create
#passenger = Passenger.new(passenger_params)
#user = User.find(current_user.id)
#transportation = Transportation.find(params[:transportation_id])
#driver = User.find(#transportation.transporter_id)
#protest = Protest.find(#transportation.destination_id)
#transportations = Transportation.where(destination_id: #protest.id)
has_ride = false
#transportations.each do |transportation|
passenger = Passenger.find_by user_id: current_user.id
unless (passenger.nil?)
has_ride = true
end
end
if has_ride
redirect_to protests_path, notice: "You already have a ride."
return
end
respond_to do |format|
if #passenger.save
format.html { redirect_to user_protest_transportation_passenger_path(id: #passenger.id), notice: 'Passenger was successfully created.' }
else
format.html { render :new }
end
end
end
def show
#driver = get_driver
if #driver
#transportation = Transportation.where(transporter_id: #driver.id).first!
#protest = Protest.find(#transportation.destination_id)
end
end
def edit
end
def update
end
def destroy
#passenger = Passenger.find_by(user_id: params[:user_id], transportation_id: params[:transportation_id])
if #passenger
#passenger.destroy
redirect_to user_protests_path, notice: 'Ride was canceled.'
else
redirect_to user_protest_transportations_path, notice: 'Error: the passenger record failed to delete.'
end
end
private
def get_driver
driver = nil
p = Passenger.find_by(user_id: current_user.id, transportation_id: params[:transportation_id])
t = Transportation.find(params[:transportation_id])
driver = User.find(t.transporter_id)
end
def passenger_params
params.permit(:user_id, :transportation_id)
end
end
I am trying to get the transportation id in the params, I tried find with session[transportation_id] but didn't seem to work.
protest controller:
class ProtestsController < ApplicationController
def index
#protests = Protest.all
end
def show
#protest = Protest.find(params[:id])
#user = current_user
end
def new
#protest = Protest.new
end
def edit
#protest = Protest.find(params[:id])
end
def create
#protest = Protest.new(protest_params)
#protest.creator = current_user
respond_to do |format|
if #protest.save
format.html { redirect_to #protest, notice: 'Protest was successfully created.' }
else
format.html { render :new }
end
end
end
def update
#protest = Protest.find(params[:id])
respond_to do |format|
if #protest.update(protest_params)
format.html { redirect_to #protest, notice: 'Protest was successfully updated.' }
else
format.html {render :edit }
end
end
end
def destroy
#protest = Protest.find(params[:id])
#protest.destroy
redirect_to protests_path
end
private
def protest_params
params.require(:protest).permit(:name, :description, :location, :starts_at, :creator, :image)
end
end

How to link_to index of another user?

In the goals show page:
<%= link_to goals_path, class: "btn" do %>
<span class="glyphicon glyphicon-list"></span> Goals
<% end %>
but instead of being taken to my own goals_path I want to be taken to the goals_path of whichever user's goal show page I'm looking at.
goals_controller
class GoalsController < ApplicationController
before_action :set_goal, only: [:show, :edit, :update, :destroy, :like]
before_action :logged_in_user, only: [:create, :destroy]
before_action :correct_user, only: [:edit, :update, :destroy]
def index
if params[:tag]
#goals = Goal.tagged_with(params[:tag])
else
#accomplished_goals = current_user.goals.accomplished.order("deadline")
#unaccomplished_goals = current_user.goals.unaccomplished.order("deadline")
end
end
def show
#goal = Goal.find(params[:id])
#commentable = #goal
#comments = #commentable.comments
#comment = Comment.new
#notable = #goal
#notes = #notable.notes
#note = Note.new
#correct_user = current_user.goals.find_by(id: params[:id])
end
def new
#goal = current_user.goals.build
end
def edit
end
def create
#goal = current_user.goals.build(goal_params)
if (params[:commit] == 'conceal')
#goal.conceal = true
#goal.save
redirect_to #goal, notice: 'Goal was successfully created'
elsif
#goal.save
track_activity #goal
redirect_to #goal, notice: 'Goal was successfully created'
else
flash.now[:danger] = 'Required Field: "Enter Goal"'
render 'new'
end
end
def update
if #goal.update(goal_params)
redirect_to goals_url, notice: 'Goal was successfully updated'
else
render action: 'edit'
end
end
def destroy
#goal.destroy
redirect_to goals_url
end
def like
#goal = Goal.find(params[:id])
#goal_like = current_user.goal_likes.build(goal: #goal)
if #goal_like.save
#goal.increment!(:likes)
flash[:success] = 'Thanks for liking!'
else
flash[:error] = 'Two many likes'
end
redirect_to(:back)
end
private
def set_goal
#goal = Goal.find(params[:id])
end
def correct_user
#goal = current_user.goals.find_by(id: params[:id])
redirect_to root_url, notice: "Not authorized to edit this goal" if #goal.nil?
end
def goal_params
params.require(:goal).permit(:name, :like, :deadline, :accomplished, :tag_list, :comment, :private_submit)
end
end
Please let me know if you need further explanation or code to help you help me :-]
If you have a target user defined (or have a way to access a user's id), you can do something like:
<% link_to goals_path(user_id: #goal.user_id) do %>
<span class="glyphicon glyphicon-list"></span> Goals
<% end %>
Then you can modify your index method to handle a user_id param:
def index
if params[:tag]
#goals = Goal.tagged_with(params[:tag])
elsif params[:user_id]
#goals = User.find(params[:user_id]).goals
else
#accomplished_goals = current_user.goals.accomplished.order("deadline")
#unaccomplished_goals = current_user.goals.unaccomplished.order("deadline")
end
end
This should render a particular user's goals if their id is passed in as a param. Hope this helps!
You could also just take a completely different route, and be a little more REST-ful about grabbing users/:user_id/goals, and add it as a route in your routes.rb
get "/users/:user_id/goals", to: "goals#user_goals", as: "user_goals"
and update your button to have
<% link_to user_goals_path(#goal_user) ... %>
and then add the goals#user_goals method
def user_goals
#goals = Goal.find_by({user_id: params[:user_id]})
render :index # or some other view
end

Select avatar from uploaded files

I have carrierwave installed and users can upload photos. How do I set so users don't have to upload a avatar file, but instead can select from their uploaded photos which one will be represented as their avatar? For example when you're on Facebook, click on one of your photos, click the 'Options' link and it shows you 'Make profile picture'. That image will then become your avatar, or picture that is used throughout Facebook. I am looking for the same thing.
Gallery Controller:
def index
#galleries = Gallery.all
end
def show
#gallery = Gallery.find(id_params)
end
def new
#gallery = Gallery.new
end
def create
#gallery = Gallery.new(gallery_params)
if #gallery.save
flash[:notice] = "Created gallery."
redirect_to #gallery
else
render :action => 'new'
end
end
def edit
#gallery = Gallery.find(id_params)
end
def update
#gallery = Gallery.find(id_params)
if #gallery.update_attributes(gallery_params)
flash[:notice] = "Updated gallery."
redirect_to gallery_url
else
render :action => 'edit'
end
end
def destroy
#gallery = Gallery.find(id_params)
#gallery.destroy
flash[:notice] = "Gallery deleted."
redirect_to galleries_url
end
private
def gallery_params
params.require(:user).permit(:name)
end
def id_params
params.require(:id).permit(:name)
end
end
Photo Controller:
def new
#photo = Photo.new
end
def create
#photo = Photo.new(params[:photo])
#photo.user = current_user
if #photo.save
flash[:notice] = "Successfully created photos."
redirect_to :back
else
render :action => 'new'
end
end
def edit
#photo = Photo.find(params[:id])
end
def update
#photo = Photo.find(params[:id])
if #photo.update_attributes(paramas[:photo])
flash[:notice] = "Successfully updated photo."
redirect_to #photo.gallery
else
render :action => 'edit'
end
end
def destroy
#photo = Photo.find(params[:id])
#photo.destroy
flash[:notice] = "Successfully destroyed photo."
redirect_to #photo.gallery
end
end
Here's an example of what I might do
class UserAvatarController < ApplicationController
def edit
#gallery = current_user.gallery
# render gallery of photos for user to choose
end
def update
if params[:photo_id].present?
current_user.update_attributes avatar_id: params[:photo_id]
else
flash[:error] = "No photo selected"
render action: "edit"
end
end
end

Unknown Action: The action 'create' could not be found for CommentsController

I'm working on an app that allows users to comment on a single "work" (think blog post). The associations in the models are as follows:
class User < ActiveRecord::Base
has_many :works
has_many :comments
class Work < ActiveRecord::Base
belongs_to :user
has_many :comments
class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :post
belongs_to :work
There's a form on the Works show page that allows users to post a comment:
<%= form_for(#comment) do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<div class="field">
<%= f.text_area :content, placeholder: "Post a comment!" %>
</div>
<%= f.submit "Post", class: "btn btn-small btn-primary" %>
<% end %>
The Works controller is as follows. Note that I'm adding the build comment functionality here so that the form on the Works page functions:
class WorksController < ApplicationController
#before_filter :current_user, only: [:edit, :update]
def index
#works = Work.all
#comment = #work.comments.build(params[:comment])
#comment.user = current_user
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => #works }
end
end
def create
#work = current_user.works.create(params[:work])
redirect_to current_user
end
def edit
#work = current_user.works.find(params[:id])
end
def new
#work = current_user.works.new
end
def destroy
#work = current_user.works.find(params[:id]).destroy
flash[:success] = "Work deleted"
redirect_to current_user
end
def update
#work = current_user.works.find(params[:id])
if #work.update_attributes(params[:work])
flash[:success] = "Profile updated"
redirect_to #work
else
render 'edit'
end
end
def show
#work = Work.find(params[:id])
#comment = #work.comments.build
#comment.user = current_user
#activities = PublicActivity::Activity.order("created_at DESC").where(trackable_type: "Work", trackable_id: #work).all
#comments = #work.comments.order("created_at DESC").where(work_id: #work ).all
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => #work }
end
end
end
And lastly, here is the Comments controller:
class CommentsController < ApplicationController
before_filter :authenticate_user!
def index
#comments = Comment.all
end
def show
#comment = Comment.find(params[:id])
#activities = PublicActivity::Activity.order("created_at DESC").where(trackable_type: "Comment", trackable_id: #comment).all
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => #comment }
end
def update
#comment = current_user.comments.find(params[:id])
if #comment.update_attributes(params[:comment])
flash[:success] = "Comment updated"
redirect_to #comment
end
end
def create
#work = Work.find(params[:id])
#comment = #work.comments.build(params[:comment])
#comment.user = current_user
if #comment.save
#flash[:success] = "Post created!"
redirect_to #work
else
render 'home#index'
end
end
end
end
When I attempt to submit a comment using the comment form on the works show view page, I get the following error:
Unknown action
The action 'create' could not be found for CommentsController
Why can't it find the create action on the Comments controller? Any help would be greatly appreciated.
Thanks!
Your comments controller show action is missing an end, i.e. this:
def show
#comment = Comment.find(params[:id])
#activities = PublicActivity::Activity.order("created_at DESC").where(trackable_type: "Comment", trackable_id: #comment).all
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => #comment }
end
should be this:
def show
#comment = Comment.find(params[:id])
#activities = PublicActivity::Activity.order("created_at DESC").where(trackable_type: "Comment", trackable_id: #comment).all
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => #comment }
end
end
(right now it is 'falling' into the create action so the create action never gets set up).
You will then probably need to change the final:
end
end
end
end
to be
end
end
end
as this was probably 'compensating' for the mismatch and allowing the page to precompile in Ruby.

Resources