hopsoft / coast Goto Github PK
View Code? Open in Web Editor NEWRESTful behavior for Rails controllers
License: MIT License
RESTful behavior for Rails controllers
License: MIT License
Actually all notice can't work with I18n :
flash[:notice] = "#{resourceful_model.name} was successfully updated."
Hi @hopsoft, I really like your gem it make my controller really skinny but :
example
resources :projects do
resources :depot_ids, :except => [:index]
[...]
I need to change respond_to and some other stuff to make it work properly but if I use the respond_to callback I can't easily check if a resource was save or not and do my redirect or my render with erros.
example
namespace :admin do
resources :contents
end
namespace :front, :path => '' do
resources :contents, :only => [:index]
end
I got the same problem :)
May be can change local var success to instance var @success ? If you agree I'll did it -)
Generally I use coast for my back office and a little bit on the front.
So I always need to do something like this :
class Back::PagesController < BackController
include Coast
# I need to set the ressource because coast look for Back::Page model
set_resourceful_model Page
respond_to :update do
if @resourceful_item.errors.empty?
# just rewrite complete respond_to for changing the redirect_to
redirect_to back_pages_path, notice: 'Page was successfully updated.'
else
@application = Page.find(params[:id])
render action: "edit"
end
end
# etc...
end
May be there is a proper way to did it, may be not.
I try to find it :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.