Undefined local variable or method `new_prepodavatels_path' - ruby-on-rails

I have a problem: After starting server I got this error:
undefined local variable or method `prepodavatels_stats_path' for #<#:0x0000000461ec58> I presented rake routes in this post.
Error on the following line
<li><%= link_to "", prepodavatels_stats_path %><li>
routes.rb
resources :prepodavatels do
collection do
get 'stats'
end
resources :predmets
resources :ppdatas
end
rake routes
Prefix Verb URI Pattern Controller#Action
groups GET /groups(.:format) groups#index
POST /groups(.:format) groups#create
new_group GET /groups/new(.:format) groups#new
edit_group GET /groups/:id/edit(.:format) groups#edit
group GET /groups/:id(.:format) groups#show
PATCH /groups/:id(.:format) groups#update
PUT /groups/:id(.:format) groups#update
DELETE /groups/:id(.:format) groups#destroy
students_index2 GET /students/index2(.:format) students#index2
students_index3 GET /students/index3(.:format) students#index3
students_index4 GET /students/index4(.:format) students#index4
students_index5 GET /students/index5(.:format) students#index5
students_index6 GET /students/index6(.:format) students#index6
stats_students GET /students/stats(.:format) students#stats
students GET /students(.:format) students#index
POST /students(.:format) students#create
new_student GET /students/new(.:format) students#new
edit_student GET /students/:id/edit(.:format) students#edit
student GET /students/:id(.:format) students#show
PATCH /students/:id(.:format) students#update
PUT /students/:id(.:format) students#update
DELETE /students/:id(.:format) students#destroy
stats_prepodavatels GET /prepodavatels/stats(.:format) prepodavatels#stats
predmets GET /prepodavatels/predmets(.:format) predmets#index
POST /prepodavatels/predmets(.:format) predmets#create
new_predmet GET /prepodavatels/predmets/new(.:format) predmets#new
edit_predmet GET /prepodavatels/predmets/:id/edit(.:format) predmets#edit
predmet GET /prepodavatels/predmets/:id(.:format) predmets#show
PATCH /prepodavatels/predmets/:id(.:format) predmets#update
PUT /prepodavatels/predmets/:id(.:format) predmets#update
DELETE /prepodavatels/predmets/:id(.:format) predmets#destroy
ppdatas GET /prepodavatels/ppdatas(.:format) ppdatas#index
POST /prepodavatels/ppdatas(.:format) ppdatas#create
new_ppdata GET /prepodavatels/ppdatas/new(.:format) ppdatas#new
edit_ppdata GET /prepodavatels/ppdatas/:id/edit(.:format) ppdatas#edit
ppdata GET /prepodavatels/ppdatas/:id(.:format) ppdatas#show
PATCH /prepodavatels/ppdatas/:id(.:format) ppdatas#update
PUT /prepodavatels/ppdatas/:id(.:format) ppdatas#update
DELETE /prepodavatels/ppdatas/:id(.:format) ppdatas#destroy
prepodavatels GET /prepodavatels(.:format) prepodavatels#index
POST /prepodavatels(.:format) prepodavatels#create
new_prepodavatel GET /prepodavatels/new(.:format) prepodavatels#new
edit_prepodavatel GET /prepodavatels/:id/edit(.:format) prepodavatels#edit
prepodavatel GET /prepodavatels/:id(.:format) prepodavatels#show
PATCH /prepodavatels/:id(.:format) prepodavatels#update
PUT /prepodavatels/:id(.:format) prepodavatels#update
DELETE /prepodavatels/:id(.:format) prepodavatels#destroy
admin GET /admin(.:format) admin#index
admin_index GET /admin/index(.:format) admin#index
ppdatas_index GET /ppdatas/index(.:format) ppdatas#index
ppdatas_index2 GET /ppdatas/index2(.:format) ppdatas#index2
index2_year_courses PATCH /year_courses/index2(.:format) year_courses#index2
year_courses GET /year_courses(.:format) year_courses#index
POST /year_courses(.:format) year_courses#create
new_year_course GET /year_courses/new(.:format) year_courses#new
edit_year_course GET /year_courses/:id/edit(.:format) year_courses#edit
year_course GET /year_courses/:id(.:format) year_courses#show
PATCH /year_courses/:id(.:format) year_courses#update
PUT /year_courses/:id(.:format) year_courses#update
DELETE /year_courses/:id(.:format) year_courses#destroy
group_new GET /groups/:group_id/new(.:format) groups#new
group_show GET /groups/:group_id/show(.:format) groups#show
PATCH /groups/index(.:format) groups#index
PATCH /groups/new(.:format) groups#new
_form_groups PATCH /groups/_form(.:format) groups#_form
PATCH /groups/show(.:format) groups#show
GET /groups(.:format) groups#index
POST /groups(.:format) groups#create
GET /groups/new(.:format) groups#new
GET /groups/:id/edit(.:format) groups#edit
GET /groups/:id(.:format) groups#show
PATCH /groups/:id(.:format) groups#update
PUT /groups/:id(.:format) groups#update
DELETE /groups/:id(.:format) groups#destroy
GET /students/index2(.:format) students#index2
GET /students/index3(.:format) students#index3
GET /students/index4(.:format) students#index4
GET /students/index5(.:format) students#index5
GET /students/index6(.:format) students#index6
students_stats GET /students/stats(.:format) students#stats
login GET /login(.:format) sessions#new
POST /login(.:format) sessions#create
logout DELETE /logout(.:format) sessions#destroy
ppdatas3 GET /ppdatas/index3(.:format) ppdatas#index3
ppdatas2 GET /ppdatas/index2(.:format) ppdatas#index2
sessions_new GET /sessions/new(.:format) sessions#new
sessions_create GET /sessions/create(.:format) sessions#create
sessions_destroy GET /sessions/destroy(.:format) sessions#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
GET /ppdatas(.:format) ppdatas#index
POST /ppdatas(.:format) ppdatas#create
GET /ppdatas/new(.:format) ppdatas#new
GET /ppdatas/:id/edit(.:format) ppdatas#edit
GET /ppdatas/:id(.:format) ppdatas#show
PATCH /ppdatas/:id(.:format) ppdatas#update
PUT /ppdatas/:id(.:format) ppdatas#update
DELETE /ppdatas/:id(.:format) ppdatas#destroy
GET /students(.:format) students#index
POST /students(.:format) students#create
GET /students/new(.:format) students#new
GET /students/:id/edit(.:format) students#edit
GET /students/:id(.:format) students#show
PATCH /students/:id(.:format) students#update
PUT /students/:id(.:format) students#update
DELETE /students/:id(.:format) students#destroy
course_years GET /courses/:course_id/years(.:format) years#index
POST /courses/:course_id/years(.:format) years#create
new_course_year GET /courses/:course_id/years/new(.:format) years#new
edit_course_year GET /courses/:course_id/years/:id/edit(.:format) years#edit
course_year GET /courses/:course_id/years/:id(.:format) years#show
PATCH /courses/:course_id/years/:id(.:format) years#update
PUT /courses/:course_id/years/:id(.:format) years#update
DELETE /courses/:course_id/years/:id(.:format) years#destroy
course_courses GET /courses/:course_id/courses(.:format) courses#index
POST /courses/:course_id/courses(.:format) courses#create
new_course_course GET /courses/:course_id/courses/new(.:format) courses#new
edit_course_course GET /courses/:course_id/courses/:id/edit(.:format) courses#edit
course_course GET /courses/:course_id/courses/:id(.:format) courses#show
PATCH /courses/:course_id/courses/:id(.:format) courses#update
PUT /courses/:course_id/courses/:id(.:format) courses#update
DELETE /courses/:course_id/courses/:id(.:format) courses#destroy
courses GET /courses(.:format) courses#index
POST /courses(.:format) courses#create
new_course GET /courses/new(.:format) courses#new
edit_course GET /courses/:id/edit(.:format) courses#edit
course GET /courses/:id(.:format) courses#show
PATCH /courses/:id(.:format) courses#update
PUT /courses/:id(.:format) courses#update
DELETE /courses/:id(.:format) courses#destroy
GET /predmets(.:format) predmets#index
POST /predmets(.:format) predmets#create
GET /predmets/new(.:format) predmets#new
GET /predmets/:id/edit(.:format) predmets#edit
GET /predmets/:id(.:format) predmets#show
PATCH /predmets/:id(.:format) predmets#update
PUT /predmets/:id(.:format) predmets#update
DELETE /predmets/:id(.:format) predmets#destroy
years GET /years(.:format) years#index
POST /years(.:format) years#create
new_year GET /years/new(.:format) years#new
edit_year GET /years/:id/edit(.:format) years#edit
year GET /years/:id(.:format) years#show
PATCH /years/:id(.:format) years#update
PUT /years/:id(.:format) years#update
DELETE /years/:id(.:format) years#destroy

Try
<li><%= link_to stats_prepodavatels_path %><li>
Does this work?

Related

Param is missing or value is empty until I refresh page

Hi guys I have really strange problem.I have events and enrollments. Every time when I want to make an enrollment for specific event Rails show me:
Error: Param is missing or value is empty: enrollment
When I refresh the page everything is Ok.
new view code:
<%=form_for :enrollment do |f|%>
<%= f.select(:car_id) do %>
<% current_user.cars.each do |c| %>
<%= content_tag(:option, c.mark, value: c.id) %>
<% end %>
<% end %>
<%=f.submit :save %>
<%end%>
Strong params:
def enrollment_params
params.require(:enrollment).permit(:car_id)
end
create method:
def create
#event=Event.find(params[:id])
#enrollment = current_user.enrollments.build(enrollment_params)
#enrollment.save
#event.enrollments<<#enrollment
end
new action:
def new
#enrollment=Enrollment.new
end
Log:
Started POST "/events/39/enrollments/new" for 127.0.0.1 at 2016-05-21 22:53:52 +0300
Processing by EnrollmentsController#create as HTML
Parameters: {"authenticity_token"=>"b4oZl8n8ALq1fgmqweygyWDF8oc7Ew3nelvhst5SRJkza8x92VNo3fXg+/gqw+NfKVPYvJfu9LCthRBGFB0xSA==", "id"=>"39"}
Event Load (0.1ms) SELECT "events".* FROM "events" WHERE "events"."id" = ? LIMIT 1 [["id", 39]]
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 12]]
Completed 400 Bad Request in 5ms (ActiveRecord: 0.2ms)
Routes:
Prefix Verb URI Pattern Controller#Action
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
user_cars GET /users/:user_id/cars(.:format) cars#index
POST /users/:user_id/cars(.:format) cars#create
new_user_car GET /users/:user_id/cars/new(.:format) cars#new
edit_user_car GET /users/:user_id/cars/:id/edit(.:format) cars#edit
user_car GET /users/:user_id/cars/:id(.:format) cars#show
PATCH /users/:user_id/cars/:id(.:format) cars#update
PUT /users/:user_id/cars/:id(.:format) cars#update
DELETE /users/:user_id/cars/:id(.:format) cars#destroy
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
event_comments GET /events/:event_id/comments(.:format) comments#index
POST /events/:event_id/comments(.:format) comments#create
new_event_comment GET /events/:event_id/comments/new(.:format) comments#new
edit_event_comment GET /events/:event_id/comments/:id/edit(.:format) comments#edit
event_comment GET /events/:event_id/comments/:id(.:format) comments#show
PATCH /events/:event_id/comments/:id(.:format) comments#update
PUT /events/:event_id/comments/:id(.:format) comments#update
DELETE /events/:event_id/comments/:id(.:format) comments#destroy
event_results GET /events/:event_id/results(.:format) results#index
POST /events/:event_id/results(.:format) results#create
new_event_result GET /events/:event_id/results/new(.:format) results#new
edit_event_result GET /events/:event_id/results/:id/edit(.:format) results#edit
event_result GET /events/:event_id/results/:id(.:format) results#show
PATCH /events/:event_id/results/:id(.:format) results#update
PUT /events/:event_id/results/:id(.:format) results#update
DELETE /events/:event_id/results/:id(.:format) results#destroy
event_enrollments GET /events/:event_id/enrollments(.:format) enrollments#index
POST /events/:event_id/enrollments(.:format) enrollments#create
new_event_enrollment GET /events/:event_id/enrollments/new(.:format) enrollments#new
edit_event_enrollment GET /events/:event_id/enrollments/:id/edit(.:format) enrollments#edit
event_enrollment GET /events/:event_id/enrollments/:id(.:format) enrollments#show
PATCH /events/:event_id/enrollments/:id(.:format) enrollments#update
PUT /events/:event_id/enrollments/:id(.:format) enrollments#update
DELETE /events/:event_id/enrollments/:id(.:format) enrollments#destroy
events GET /events(.:format) events#index
POST /events(.:format) events#create
new_event GET /events/new(.:format) events#new
edit_event GET /events/:id/edit(.:format) events#edit
event GET /events/:id(.:format) events#show
PATCH /events/:id(.:format) events#update
PUT /events/:id(.:format) events#update
DELETE /events/:id(.:format) events#destroy
GET /attend/:id(.:format) events#attend
POST /cancel/:id(.:format) events#cancel
all GET /all(.:format) users#all
POST /all(.:format) users#all
myevents GET /myevents(.:format) users#myevents
POST /myevents(.:format) users#myevents
POST /events/:id/comments/new(.:format) comments#create
GET /events/:id/comments(.:format) comments#index
PUT /events/:id/comments/:id/edit(.:format) comments#edit
POST /events/:id/like(.:format) events#like
GET /events/:id/like(.:format) events#like
POST /events/:id/unlike(.:format) events#unlike
GET /events/:id/unlike(.:format) events#unlike
POST /users/:id/cars/new(.:format) cars#create
DELETE /events/:id/enrollments/:id(.:format) enrollments#destroy
GET /users/:id/usercars(.:format) users#usercars
GET /users/:id/userevents(.:format) users#userevents
POST /events/:id/results/new(.:format) results#create
GET /events/:id/statistics(.:format) results#statistics
GET /events/:id/classfwd(.:format) results#classfwd
GET /events/:id/classrwd(.:format) results#classrwd
GET /events/:id/classawd(.:format) results#classawd
GET /events/:id/enrollments(.:format) enrollments#index
GET /users/:id/mygallery(.:format) users#mygallery
root GET / welcome#Welcome
Your error log shows you are trying to commit a post when going to "/events/39/enrollments/new". This route needs to be a 'get' request or it will try to post to the server without any parameters included! Go into your config/routes file and change that from a 'post' to a 'get' route and this shouldn't happen.
Edit: You need to include the nested attribute in your form:
<%= form_for([#event, #enrollment]) do |f| %>
You then need to define #event in your new action with the params being passed in the url to it as you do in the create action. Using these objects instead of :enrollment should also guide it to using the right action (create) instead of posting to new.

Ruby app: link_to 'delete' looking for GET

I realize this question has been asked many times, but I've tried all the solutions I can find, and have gotten nowhere.
In my view, I have
= link_to "Delete", evint_path(e), :method => :delete, data: {:confirm => 'Are you sure?'}
where e is an instance of evint. I keep getting error messages declaring that I'm missing a GET method for evint:
No route matches [GET] "/evints/5"
This isn't even the case! When I rake routes, I have a GET route for evints.
I have jquery-rails in my Gemfile; I have "require jquery_ujs" in my application.js file. I have five other apps on the same system that work, so I don't think it's a system problem.
The html being generated by my code looks OK:
<a rel="nofollow" href="/evints/5" data-method="delete" data-confirm="Are you sure?">Delete</a>
I've tried removing "//= require tree ." from my application.js file, but that didn't make any difference.
I'm also having trouble signing out of my app, as devise's destroy_session also isn't working!
Does anybody have any ideas? This is driving me crazy!
EDIT: Here are my routes:
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
user_confirmation POST /users/confirmation(.:format) devise/confirmations#create
new_user_confirmation GET /users/confirmation/new(.:format) devise/confirmations#new
GET /users/confirmation(.:format) devise/confirmations#show
interests GET /interests(.:format) interests#index
POST /interests(.:format) interests#create
new_interest GET /interests/new(.:format) interests#new
edit_interest GET /interests/:id/edit(.:format) interests#edit
interest GET /interests/:id(.:format) interests#show
PATCH /interests/:id(.:format) interests#update
PUT /interests/:id(.:format) interests#update
DELETE /interests/:id(.:format) interests#destroy
events GET /events(.:format) events#index
POST /events(.:format) events#create
new_event GET /events/new(.:format) events#new
edit_event GET /events/:id/edit(.:format) events#edit
event GET /events/:id(.:format) events#show
PATCH /events/:id(.:format) events#update
PUT /events/:id(.:format) events#update
DELETE /events/:id(.:format) events#destroy
images GET /images(.:format) images#index
POST /images(.:format) images#create
new_image GET /images/new(.:format) images#new
image GET /images/:id(.:format) images#show
DELETE /images/:id(.:format) images#destroy
evints GET /evints(.:format) evints#index
POST /evints(.:format) evints#create
new_evint GET /evints/new(.:format) evints#new
evint DELETE /evints/:id(.:format) evints#destroy
projects GET /projects(.:format) projects#index
POST /projects(.:format) projects#create
new_project GET /projects/new(.:format) projects#new
edit_project GET /projects/:id/edit(.:format) projects#edit
project PATCH /projects/:id(.:format) projects#update
PUT /projects/:id(.:format) projects#update
projectimages GET /projectimages(.:format) projectimages#index
POST /projectimages(.:format) projectimages#create
new_projectimage GET /projectimages/new(.:format) projectimages#new
projectimage GET /projectimages/:id(.:format) projectimages#show
DELETE /projectimages/:id(.:format) projectimages#destroy
welcome_index GET /welcome/index(.:format) welcome#index
root GET / welcome#index
welcome_readpdf GET /welcome/readpdf(.:format) welcome#readpdf

Devise Edit user error prohibited this user from being saved

I keep getting the following error when i try to submit my edit user page. I am using devise and think something is wrong with my strong parameters. I have already ready through the devise docs etc but i have confused myself with this so some guidance would be most appreciated!
Thanks
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :password) }
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :line1, :line2, :town, :county, :postcode)}
end
private
def after_sign_in_path_for(resource)
edit_user_registration_path(current_user) #basically whichever path you think meets your needs
end
end
These are my routes
Prefix Verb URI Pattern Controller#Action
subscriptions POST /subscriptions(.:format) subscriptions#create
new_subscription GET /subscriptions/new(.:format) subscriptions#new
subscription GET /subscriptions/:id(.:format) subscriptions#show
DELETE /subscriptions/:id(.:format) subscriptions#destroy
content_fruit GET /content/fruit(.:format) content#fruit
content_veg GET /content/veg(.:format) content#veg
content_mix GET /content/mix(.:format) content#mix
new_admin_user_session GET /admin/login(.:format) active_admin/devise/sessions#new
admin_user_session POST /admin/login(.:format) active_admin/devise/sessions#create
destroy_admin_user_session DELETE|GET /admin/logout(.:format) active_admin/devise/sessions#destroy
admin_user_password POST /admin/password(.:format) active_admin/devise/passwords#create
new_admin_user_password GET /admin/password/new(.:format) active_admin/devise/passwords#new
edit_admin_user_password GET /admin/password/edit(.:format) active_admin/devise/passwords#edit
PATCH /admin/password(.:format) active_admin/devise/passwords#update
PUT /admin/password(.:format) active_admin/devise/passwords#update
admin_root GET /admin(.:format) admin/dashboard#index
batch_action_admin_admin_users POST /admin/admin_users/batch_action(.:format) admin/admin_users#batch_action
admin_admin_users GET /admin/admin_users(.:format) admin/admin_users#index
POST /admin/admin_users(.:format) admin/admin_users#create
new_admin_admin_user GET /admin/admin_users/new(.:format) admin/admin_users#new
edit_admin_admin_user GET /admin/admin_users/:id/edit(.:format) admin/admin_users#edit
admin_admin_user GET /admin/admin_users/:id(.:format) admin/admin_users#show
PATCH /admin/admin_users/:id(.:format) admin/admin_users#update
PUT /admin/admin_users/:id(.:format) admin/admin_users#update
DELETE /admin/admin_users/:id(.:format) admin/admin_users#destroy
admin_dashboard GET /admin/dashboard(.:format) admin/dashboard#index
batch_action_admin_products POST /admin/products/batch_action(.:format) admin/products#batch_action
admin_products GET /admin/products(.:format) admin/products#index
POST /admin/products(.:format) admin/products#create
new_admin_product GET /admin/products/new(.:format) admin/products#new
edit_admin_product GET /admin/products/:id/edit(.:format) admin/products#edit
admin_product GET /admin/products/:id(.:format) admin/products#show
PATCH /admin/products/:id(.:format) admin/products#update
PUT /admin/products/:id(.:format) admin/products#update
DELETE /admin/products/:id(.:format) admin/products#destroy
admin_comments GET /admin/comments(.:format) admin/comments#index
POST /admin/comments(.:format) admin/comments#create
admin_comment GET /admin/comments/:id(.:format) admin/comments#show
admin_dashboard_index GET /admin/dashboard/index(.:format) admin/dashboard#index
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel
user_registration POST /users(.:format) devise/registrations#create
new_user_registration GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration GET /users/edit(.:format) devise/registrations#edit
PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
product_orders POST /products/:product_id/orders(.:format) orders#create
new_product_order GET /products/:product_id/orders/new(.:format) orders#new
products GET /products(.:format) products#index
POST /products(.:format) products#create
new_product GET /products/new(.:format) products#new
edit_product GET /products/:id/edit(.:format) products#edit
product GET /products/:id(.:format) products#show
PATCH /products/:id(.:format) products#update
PUT /products/:id(.:format) products#update
DELETE /products/:id(.:format) products#destroy
home_about GET /home/about(.:format) home#about
home_contact GET /home/contact(.:format) home#contact
seller GET /seller(.:format) products#seller
sales GET /sales(.:format) orders#sales
static_pages_productlanding GET /static_pages/productlanding(.:format) static_pages#productlanding
GET /content/veg(.:format) content#veg
GET /content/fruit(.:format) content#fruit
GET /content/mix(.:format) content#mix
subscriptions_new GET /subscriptions/new(.:format) subscriptions#new
root GET / static_pages#home
contacts POST /contacts(.:format) contact_us/contacts#create
new_contact GET /contacts/new(.:format) contact_us/contacts#new
contact_us GET /contact-us(.:format) contact_us/contacts#new
Your going to want to generate the devise registration controller. Below is a link with instructions on how to do that.
https://github.com/plataformatec/devise/wiki/Tool:-Generate-and-customize-controllers
You are going to throw this command into your terminal.
bash <(curl -s https://raw.githubusercontent.com/foohey/cdc/master/cdc.sh)
Once you have your registration controller generated you are going to want to put this code in it.
private
def sign_up_params
params.require(:user).permit(:name, :email, :password)
end
def account_update_params
params.require(:user).permit(:name, :line1, :line2, :town, :county, :postcode)
end
Hope this helps.

difficulty with member routes

UPDATE: This was all a horrible mistake - I was updating the wrong routes file!
this does work: get 'users/:id/groups/' => 'users#groups'
I'd like to be able to see groups that belong to a specific user but I'm having trouble setting up a route that would resolve to:
/users/:id/groups
for some reason. I'm guessing devise is getting in the way, perhaps.
i've tried the following:
resources :users
match '/users/:id/groups', to: 'users#groups', via: :get
and
resources :users do
member do
get 'groups'
end
end
such a route never shows up when i call rake routes:
$ rake routes
Prefix Verb URI Pattern Controller#Action
groups GET /groups(.:format) groups#index
POST /groups(.:format) groups#create
new_group GET /groups/new(.:format) groups#new
edit_group GET /groups/:id/edit(.:format) groups#edit
group GET /groups/:id(.:format) groups#show
PATCH /groups/:id(.:format) groups#update
PUT /groups/:id(.:format) groups#update
DELETE /groups/:id(.:format) groups#destroy
calendar GET /calendar(/:year(/:month))(.:format) calendar#index {:year=>/\d{4}/, :month=>/\d{1,2}/}
root GET / calendar#index
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password POST /users/password(.:format) devise/passwords#create
new_user_password GET /users/password/new(.:format) devise/passwords#new
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration GET /users/cancel(.:format) registrations#cancel
user_registration POST /users(.:format) registrations#create
new_user_registration GET /users/sign_up(.:format) registrations#new
edit_user_registration GET /users/edit(.:format) registrations#edit
PATCH /users(.:format) registrations#update
PUT /users(.:format) registrations#update
DELETE /users(.:format) registrations#destroy
user_confirmation POST /users/confirmation(.:format) devise/confirmations#create
new_user_confirmation GET /users/confirmation/new(.:format) devise/confirmations#new
GET /users/confirmation(.:format) devise/confirmations#show
accept_user_invitation GET /users/invitation/accept(.:format) devise/invitations#edit
remove_user_invitation GET /users/invitation/remove(.:format) devise/invitations#destroy
user_invitation POST /users/invitation(.:format) devise/invitations#create
new_user_invitation GET /users/invitation/new(.:format) devise/invitations#new
PATCH /users/invitation(.:format) devise/invitations#update
PUT /users/invitation(.:format) devise/invitations#update
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
events GET /events(.:format) events#index
POST /events(.:format) events#create
new_event GET /events/new(.:format) events#new
edit_event GET /events/:id/edit(.:format) events#edit
event GET /events/:id(.:format) events#show
PATCH /events/:id(.:format) events#update
PUT /events/:id(.:format) events#update
DELETE /events/:id(.:format) events#destroy
Why are you specifying member when you're trying to nest the resource? Did you try simply
resources :users do
resources :groups, only: :index
end

Rails Devise_invitable routes error after send invite

I have the devise_invitable gem installed and got a working view (users/invitation/new) where I can send invitation to some email. Once I hit the "send an invitation" button. I got redirected to /invitations/user with the routing error "No route matches [POST] "/invitations/user". I appreciated if anyone has idea why the gem redirect to this new route which is not defined. Did I miss a step in the installation? Below is my current rake routes info:
root / landing#index
landing_index GET /landing/index(.:format) landing#index
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
user_omniauth_callback /users/auth/:action/callback(.:format) devise/omniauth_callbacks#(?-mix:(?!))
cancel_user_registration GET /users/cancel(.:format) registrations#cancel
user_registration POST /users(.:format) registrations#create
new_user_registration GET /users/sign_up(.:format) registrations#new
edit_user_registration GET /users/edit(.:format) registrations#edit
PUT /users(.:format) registrations#update
DELETE /users(.:format) registrations#destroy
user_unlock POST /users/unlock(.:format) devise/unlocks#create
new_user_unlock GET /users/unlock/new(.:format) devise/unlocks#new
GET /users/unlock(.:format) devise/unlocks#show
accept_user_invitation GET /users/invitation/accept(.:format) devise/invitations#edit
user_invitation POST /users/invitation(.:format) devise/invitations#create
new_user_invitation GET /users/invitation/new(.:format) devise/invitations#new
PUT /users/invitation(.:format) devise/invitations#update
posts GET /posts(.:format) posts#index
POST /posts(.:format) posts#create
new_post GET /posts/new(.:format) posts#new
edit_post GET /posts/:id/edit(.:format) posts#edit
post GET /posts/:id(.:format) posts#show
PUT /posts/:id(.:format) posts#update
DELETE /posts/:id(.:format) posts#destroy
profiles GET /profiles(.:format) profiles#index
POST /profiles(.:format) profiles#create
new_profile GET /profiles/new(.:format) profiles#new
edit_profile GET /profiles/:id/edit(.:format) profiles#edit
profile GET /profiles/:id(.:format) profiles#show
PUT /profiles/:id(.:format) profiles#update
DELETE /profiles/:id(.:format) profiles#destroy

Resources