emaglio / blog Goto Github PK
View Code? Open in Web Editor NEWOur new Trailblazer sample app
Our new Trailblazer sample app
Having this in order to get back to the right pipe when handling an error.
Example:
module Post::Lib class Error extend Uber::Callable def self.call(options, *) options["model"] = Post.new(title: "Post not found!") Trailblazer::Operation::Flow.pass! end end end
if a step return false the flow is moving to the fail pipe
class BlogPost::New < Trailblazer::Operation
step Policy::Guard( :authorize! )
step Model ( BlogPost, :new )
step Contract::Build( constant: BlogPost::Contract::Create )
def authorize!(options, current_user:, **)
current_user.signed_in?
end
end
Use the new render
Raise NotAuthorizedError when the Policy fails in order to show a flash message
The font color and the background color of the menu item are both white so when the cursor is over one of them them, the items disappears. Dynamically change font color when cursor is over it.
it's possible to delete the title and save without it...
Bug in formular
Add my controller to manage all Post that a user has created.
Create a good way to go back and forward between Post owner and Admin when a Post is either approved/declined/edited
Only admin can change the status of a Post (Pending, Approved, Declined)
New syntax with TRB2.0
For some reason the url_for is not pointing to the correct path
step Model(**, :find_by)
returns always false, params
doesn't have id
Use Policy method in the cell files instead of current_user == "[email protected]"
For User if the properties have the correct format.
Adding more complex validation where for example in User::ChangePassword check if the password is ok only if user exists and so on
Move this:
Trailblazer::Cell.class_eval do
def policy
context[:policy]
end
def tyrant
context[:tyrant]
end
end
into a Module and include it in all cell classes
path for the views and the error_messages I guess should be the absolute path of my computer!!!
Not sure how to validate if the User exists before resetting his password from tyrant gem....need @apotonick help!
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.