Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: specifying the available parameters and their Syntax #93

Open
hubyhuby opened this issue Apr 6, 2018 · 5 comments
Open
Labels
documentation Something is missing in the docs
Milestone

Comments

@hubyhuby
Copy link

hubyhuby commented Apr 6, 2018

The tag library is very powerful.
Also some of the parameters you can pass to the tags are not explained in the docs.
It would be nice to explain :

  1. What is the syntax logic you use to pass the parameters
  2. What are the actual parameters we can pass.
    Lots of parameters exist in the underlying HTML values. But can we override them all ??? Is it limited to a subset?

For example an useful example forwarded by Antonio:
<%= f.TextAreaTag("Description", {hide_label: true, "onfocusout": "validate()"}) %>

@hubyhuby
Copy link
Author

hubyhuby commented Apr 6, 2018

Another related question on the syntax:
Why do we use "value: 2" to specify "selected".
I am not sure if the syntax is coherent here... shouldn t we say "selected:2"

<%= f.SelectTag({name: "TalkFormatID", options: {"one": 1, "two": 2}, value: 2}) %>

produce
``

one two ``

@flyinprogrammer
Copy link

similarly, simple things like:

<%= f.InputTag("SomeInput", {"disabled": ""}) %>

for disabling an InputTag weren't entirely obvious.

@vikram-rawat
Copy link

I copied the literal statement from documentation

<%= f.TextAreaTag({"name": "Description"}){ %>
    Complex Description
    With Spaces and all the things :)
<%= } %>

I just change the name to what I wanted and It didn't work.

I don't know why but this is what I get.

I am really sorry but I think documentation is not being updated as frequently as the library itself.

testforms/new.html: line 6: line 2: map[value:Value Description] (map[string]interface {}) is an invalid argument for f.TextAreaTag at pos 0: expected (string)
github.com/gobuffalo/pop.(*Connection).Transaction.func1
c:/projects/src/github.com/gobuffalo/pop/connection.go:134
github.com/gobuffalo/pop.(*postgresql).Lock
c:/projects/src/github.com/gobuffalo/pop/dialect_postgresql.go:184
github.com/gobuffalo/pop.(*Connection).Transaction
c:/projects/src/github.com/gobuffalo/pop/connection.go:121
github.com/gobuffalo/buffalo-pop/pop/popmw.Transaction.func2.1
c:/projects/src/github.com/gobuffalo/buffalo-pop/pop/popmw/tx.go:39
github.com/gobuffalo/mw-csrf.glob..func1.1
c:/projects/src/github.com/gobuffalo/mw-csrf/csrf.go:120
github.com/gobuffalo/mw-paramlogger.parameterLogger.Middleware.func1
c:/projects/src/github.com/gobuffalo/mw-paramlogger/param_logger.go:63
github.com/gobuffalo/mw-forcessl.Middleware.func1.1
c:/projects/src/github.com/gobuffalo/mw-forcessl/forcessl.go:26
github.com/gobuffalo/buffalo.sessionSaver.func1
c:/projects/src/github.com/gobuffalo/buffalo/session.go:70
github.com/gobuffalo/buffalo.RequestLoggerFunc.func1
c:/projects/src/github.com/gobuffalo/buffalo/request_logger.go:54
github.com/gobuffalo/buffalo.(*App).PanicHandler.func1
c:/projects/src/github.com/gobuffalo/buffalo/errors.go:82
github.com/gobuffalo/buffalo.(*App).defaultErrorMiddleware.func1
c:/projects/src/github.com/gobuffalo/buffalo/errors.go:88
github.com/gobuffalo/buffalo.RouteInfo.ServeHTTP
c:/projects/src/github.com/gobuffalo/buffalo/route_info.go:108
github.com/gobuffalo/buffalo.(*RouteInfo).ServeHTTP
<autogenerated>:1
github.com/gorilla/mux.(*Router).ServeHTTP
c:/projects/src/github.com/gorilla/mux/mux.go:215
github.com/markbates/refresh/refresh/web.ErrorChecker.func1
c:/projects/src/github.com/markbates/refresh/refresh/web/web.go:23
net/http.HandlerFunc.ServeHTTP
C:/Go/src/net/http/server.go:1964
github.com/gobuffalo/buffalo.(*App).ServeHTTP
c:/projects/src/github.com/gobuffalo/buffalo/server.go:126
net/http.serverHandler.ServeHTTP
C:/Go/src/net/http/server.go:2741
net/http.(*conn).serve
C:/Go/src/net/http/server.go:1847
runtime.goexit
C:/Go/src/runtime/asm_amd64.s:1333
github.com/gobuffalo/buffalo.sessionSaver.func1
c:/projects/src/github.com/gobuffalo/buffalo/session.go:72
github.com/gobuffalo/buffalo.RequestLoggerFunc.func1
c:/projects/src/github.com/gobuffalo/buffalo/request_logger.go:54
github.com/gobuffalo/buffalo.(*App).PanicHandler.func1
c:/projects/src/github.com/gobuffalo/buffalo/errors.go:82
github.com/gobuffalo/buffalo.(*App).defaultErrorMiddleware.func1
c:/projects/src/github.com/gobuffalo/buffalo/errors.go:88
github.com/gobuffalo/buffalo.RouteInfo.ServeHTTP
c:/projects/src/github.com/gobuffalo/buffalo/route_info.go:108
github.com/gobuffalo/buffalo.(*RouteInfo).ServeHTTP
<autogenerated>:1
github.com/gorilla/mux.(*Router).ServeHTTP
c:/projects/src/github.com/gorilla/mux/mux.go:215
github.com/markbates/refresh/refresh/web.ErrorChecker.func1
c:/projects/src/github.com/markbates/refresh/refresh/web/web.go:23
net/http.HandlerFunc.ServeHTTP
C:/Go/src/net/http/server.go:1964
github.com/gobuffalo/buffalo.(*App).ServeHTTP
c:/projects/src/github.com/gobuffalo/buffalo/server.go:126
net/http.serverHandler.ServeHTTP
C:/Go/src/net/http/server.go:2741
net/http.(*conn).serve
C:/Go/src/net/http/server.go:1847
runtime.goexit
C:/Go/src/runtime/asm_amd64.s:1333

@vikram-rawat
Copy link

However

<%= f.TextAreaTag("State") %>

works just fine.

@sio4 sio4 added the documentation Something is missing in the docs label Sep 4, 2022
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 5, 2022
@sio4 sio4 added this to the Backlog milestone Oct 5, 2022
@sio4 sio4 removed the stale label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Something is missing in the docs
Projects
None yet
Development

No branches or pull requests

4 participants