Questions tagged [ihp]

Questions related to the Haskell web framework IHP (integrated Haskell Platform). https://ihp.digitallyinduced.com/

81 questions
1
vote
1 answer

build/ihp-lib/Makefile.dist: No such file or directory

$ make -B build/ihp-lib Makefile:30: build/ihp-lib/Makefile.dist: No such file or directory make: *** No rule to make target 'build/ihp-lib/Makefile.dist'. Stop. Try to run make -B build/ihp-lib to create the…
moodtwo
  • 11
  • 2
1
vote
0 answers

IHP - Morphdom interfering with other JavaScript (e.g. DyGraph)

I am using IHP and IHP's use of Morphdom and / or Turbolinks seems to interfere with some other JavaScript things when the page isn't a fresh load. This includes things like Elm apps, and in this example, Dygraph: Uncaught ReferenceError: Dygraph is…
Chris Schankula
  • 303
  • 1
  • 6
1
vote
1 answer

Custom route, but keep some routes as the automatic ones

I've added a few Actions on top of the CRUD ones, and I want to have custom routes to the new actions. But still, keep the CRUD actions with the same route (e.g. /ShowPost?postId=[uuid] instance HasPath PostsController where -- ... pathTo…
amitaibu
  • 1,026
  • 1
  • 7
  • 23
1
vote
1 answer

IHP - Is there a way to set the static assets directory?

I believe by default the IHP static directory is a relative directory to pwd/static. Is there a way to set it to another, fixed directory?
Chris Schankula
  • 303
  • 1
  • 6
1
vote
1 answer

How to pass an action into Application.Helper.View

In Application.Helper.View I would like to create an HTML component like: button :: action -> Text -> Html button action label = [hsx|{label}|] which I can use in various views like: {button NewSessionAction…
1
vote
1 answer

How to handle form control for PostgreSQL’s point type in IHP?

IHP's PostgreSQL implementation supports the POINT column type, and the IHP API has functions to parse and serialize, but I how to create form fields in a New and Edit View for it?
1
vote
1 answer

IHP - How to use multiple collectionFetchRelated?

I have the following Comments schema: Table: Comments Columns: id, post_id, body, user_id, created_at I want to fetch comments with its respective post and user. Using collectionFetchRelated for one column is simple: comments <- query @Comment …
Varun Rajput
  • 235
  • 1
  • 7
1
vote
1 answer

Dealing with complex query results in IHP without having to manually specify columns?

The "Dealing With Complex Query Results" section of https://ihp.digitallyinduced.com/Guide/database.html shows how you can "include extra data" when querying for a database type, by creating a type like this: data PostWithCommentsCount =…
L42
  • 3,052
  • 4
  • 28
  • 49
1
vote
1 answer

IHP - How to use fetchRelated with fetchOneOrNothing?

This is my schema: Posts: id roomsId Rooms: id RoomEvents: id roomId userId created_at The query I'm writing is: action MyAction { .. } = do . . roomEvent <- query @RoomEvent |> filterWhere (#roomId, roomId) |> orderBy #createdAt |>…
Varun Rajput
  • 235
  • 1
  • 7
1
vote
1 answer

Not getting results from IHP DataSync despite setting Row Level Policy

I want to use DataSync on my current application, using IHP 0.16. I believe I have followed all the installation steps in FrontController and Routes. I have a characters table with a user_id column connected to the users table. I have set the policy…
1
vote
1 answer

Accessing user fields in controller helper does not work

Context In a controller, I have a function that is called via beforeAction to check if a certain field on user is null or not. If it is null, the user should be redirected to a certain action in another controller. Since I want to call this function…
1
vote
1 answer

How to lock an action on a Controller to process actions in sequence rather than parallel

This is a follow-up to a question from How to iterate over values upon validation In my bid service I'd like to make sure that each submitted bid has a price higher than the one before. However, several bids may be submitted by different users at at…
amitaibu
  • 1,026
  • 1
  • 7
  • 23
1
vote
1 answer

redirectTo works but does not change URL in IHP

Context I have 2 controllers: LessonsController (with views Index and Show) QuizAnswersController (no views) In accordance with the generated controller code, in LessonsController the ShowLessonAction renders ShowView. In ShowView, I have a link…
1
vote
0 answers

Record construction with named fields in HSX

I have the following inside an HSX expression: Last Name With that, it's not clear which…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
1
vote
1 answer

PostsController for href attribute

The following: instance View EditView where html EditView { .. } = [hsx|